Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Date/time comparison

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

    Date/time comparison

    Hi,

    I'd like to learn how to compare an arbitrarily defined date and time with the output from DateTime.

    I understand this bit:

    DateTime mydatetime = Time[0];
    mydatetime.Date mydatetime.Minute, etc.
    When I Print this value I get "2/25/2011 12:00:00 AM" for example, cool.

    Now, are DateTimes strings? How do I store and express my arbitrary date time? for example I'd like to enter 1/1/2000 12:00:00 AM and compare it to Time[0] to see if the current time is past 1/1/2000 or before it.

    Thanks!

    #2
    Hello,

    Thanks for the note.

    This is more of a c# programming concept. Would suggest you check into this:

    Represents an instant in time, typically expressed as a date and time of day.




    To get these I googled c# DateTime.

    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Thanks Brett,
      Had already been there--have been working with c# for about 3 days

      Anyhow taking a second look I found what I needed to find:

      DateTime test = new DateTime(2011,2,1,7,47,0);

      So thanks!

      Comment


        #4
        Excellent, no problem. If you run into anything specific you need help on don't hesitate to let me know. Even if its c# related I might be able to head you in right direction or provide a specific example that might help and would be happy to do it.

        Have a great rest of the day.
        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        164 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        319 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        246 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        350 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X