Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time from epoch (1970)

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

    Time from epoch (1970)

    Hello ninjaz,

    i have a question..is there a way i could get the time from the starting of the epoch ( 1970 ) in miliseconds and in seconds?
    i couldn't figure this out...

    thanks in advance

    #2
    Qualitiedx,

    I am happy to assist you.

    What are you using this for? Could you please clarify?

    This would just be factoring in the number of years that elapsed, then accounting for months, days, hours, minutes, etc.

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Epoch typically is the number of milliseconds (which should include leap seconds / milliseconds) starting from 1970; you can use any start time / date as a start reference point if you'd like.

      Basically, you can make use of .NET DateTime object.

      Code:
      private DateTime startOfEpoch = new DateTime(1970, 1, 1);
      The above can be used as a referenced

      Code:
      double cTime = (startOfEpoch).TotalMilliseconds;
      cTime in this case should have the current time in epoch.

      This is done from memory, but should get you started.

      good luck, and happy holidays!
      mrlogik
      NinjaTrader Ecosystem Vendor - Purelogik Trading

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      566 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X