Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Printing short formate time to output window

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

    Printing short formate time to output window

    Hello,

    I need to print the current time in a short format: "08:30" ... "15:30" (without AM/PM and with "0" in "08:30"). "Print(Time[0].ToString()); gives the full date/time which I don't need." Would you please help?

    Thank you.

    #2
    Hello dmitry75,

    Thank you for your post.

    You can use TimeOfDay to achieve this:
    Code:
    Print(Time[0].TimeOfDay.ToString());
    This will however keep the ':00' at the end of the time, you may wish to look into regular expression in .NET to alter strings: http://msdn.microsoft.com/en-us/library/hs600312.aspx

    Please let me know if I may be of further assistance.

    Comment


      #3
      Thank you, actually I needed the real time, not the bar time. Maybe it would be useful to somebody:

      Code:
      Print (Bars.MarketData.Connection.Now.ToString("HH:mm");
      Last edited by dmitry75; 09-18-2013, 03:01 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 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
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X