Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exporting Historical Data (Date Format Issue)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Exporting Historical Data (Date Format Issue)

    When I export my historical data, the date value is in this format:

    20090401 000100
    C# cannot parse this through:

    Code:
    DateTime.parse("20090401 000100");
    My question is, is there a way to edit the format in which it outputs the date? If not, do any of you know of a workaround to get the date string into the correct format?

    #2
    Hello Zwentz,

    Thank you for your post.

    Unfortunately, there is no way to change this output format. Likewise, I am not aware of any automated way to change this portion of the file.
    KyleNinjaTrader Customer Service

    Comment


      #3
      You just have to use:

      Code:
      DateTime.ParseExact("20090401 00100");
      And it works.
      Last edited by zwentz; 07-10-2009, 11:06 AM.

      Comment


        #4
        zwentz,

        Maybe there is some misunderstanding here. Exporting historical data exports a text file. Text files contain just numbers. Numbers are not DateTime objects as seen in C#.

        If you want to create a DateTime out of those numbers you need to just create the object in a manner acceptable.

        DateTime someVar = new DateTime(year, month, day, hour, minute, second)

        You will need to parse the string yourself.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        144 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        70 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        125 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        78 views
        0 likes
        Last Post PaulMohn  
        Working...
        X