Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:36:34+00:00 2026-06-04T05:36:34+00:00

I am populating a list results with dates. In a query result I am

  • 0

I am populating a list “results” with dates. In a query result I am getting a set of values .. where date value is in this format ..

20120510000000000

In my code, I am doing the following..

    query = service.GetData();
    List<String> results = new List<String>();
    foreach (var item in query)
    {
        results.Add(item.InDate);  
        //This is in this format - 20120510000000000
        //Here I want to convert to mm-dd-yyyy                              
    }
    return results;

I would like to convert the above date format into “mm/dd/yyyy” and post it to “results” list.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:36:35+00:00Added an answer on June 4, 2026 at 5:36 am

    If the date is guaranteed to be in the [year][month][day][hour][minute][second][millisecond] format (looks like it), you can use a simple string manipulation:

    var newDate = item.InDate.Substring(2, 2) + "-" +
                  item.InDate.Substring(4, 2) + "-" +
                  item.InDate.Substring(0, 4);
    

    if you want it in a DateTime object, you can use the DateTime.ParseExact method:

    var newDate = DateTime.ParseExact(indate, "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have this code for populating a list of comments to return: foreach
I have a drop down list that I am populating with the result set
I am populating a list with about 25,000 items, using code like this: var
I am using a ToolStripComboBox to list some data. I am populating this combo
I am unable to get this code to sort a list of objects using
I am populating a collection List from data from a database. The database results
i'm populating a list view to view my record, i've the following code... super.onCreate(savedInstanceState);
I am having issues populating a List of User defined object attributes in Struts2.
i have a dropdownlist that populates from the sql server database. populating the list
1.) My main.xml contains : <ListView android:id="@+id/lsym" android:layout_width="wrap_content" android:layout_height="wrap_content"/> 2.) After populating the list,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.