Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting Current Time in NT timezone

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

    Getting Current Time in NT timezone

    Hi , In my indicator I am accessing the current time using "DateTime.Now". I have GMT+8 timezone in NT and GMT-8 timezone in laptop. The method DateTime.Now is giving the DateTime in laptop timezone(GMT-8) instead of NT timezone (GMT+8). How to get the current time in NT timezone ?

    #2
    Hello nandhumca,

    Thanks for your post.

    You could use NinjaTrader.Core.Globals.Now to access the current date and time in a custom NinjaScript.

    If you are wanting to get the time of the bars, you could use Time[0].

    See this help guide for more information on Time[]: https://ninjatrader.com/support/help...eries_time.htm

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Thanks Brandon.It is working as expected.
      Last edited by nandhumca; 09-22-2021, 10:31 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      68 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      151 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X