Announcement

Collapse
No announcement yet.

how to return date or time always in two digits?

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

  • how to return date or time always in two digits?

    Hi. I'm using writeln to write intraday data to a text file but the data must be in a certain format. Can anyone suggest the correct code to define a variable which will return, e.g. the hour of the current bar, always in two digits. For example, I would like to be able to write one in the morning as 01, nine in the morning as 09, and ten in the morning as 10. That is I need the zero in front of the returned value if the value is a single digit. I'd also like to be able to do this with month, day, minute and second.
    Any suggestions would be appreciated?

    Mike

  • #2
    http://forum.esignalcentral.com/show...ighlight=%3C10 has some ideas

    Comment


    • #3
      Thanks David. It works very well.

      Mike

      Comment

      Working...
      X