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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        87 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        106 views
        0 likes
        Last Post CarlTrading  
        Working...
        X