Download MetaTrader 5
To add comments, please log in or register
Do you keep a blog? Place a link to MQL5.community there and make money!
enjoysmath
64
enjoysmath 2015.07.21 18:17 

How do I get at the datetime string?  In the sense that the following code will then work:

 

        datetime now = TimeCurrent();
        
        almostUniqueIndex = StringSubstr(now, StringLen(now) - 3) + WindowsTotal();

 

I'm in the processing of migrating legacy mql4 to updated mql4. 

enjoysmath
64
enjoysmath 2015.07.21 18:20  

Found it:

TimeToStr

Converts value containing time in seconds that has passed since January 1, 1970, into a string of "yyyy.mm.dd hh:mi" format.

string  TimeToStr(
   datetime  value,                           // value
   int       mode=TIME_DATE|TIME_MINUTES      // format
   );

JD4
1101
JD4 2015.07.21 18:21  

https://docs.mql4.com/convert


Edit: By the time this post of mine was made, you had apparently already posted your self reply.  Glad you were able to find the solution for your problem.

enjoysmath
64
enjoysmath 2015.07.21 18:31  
Thanx.  So what I really need is TimeToString with TIME_SECONDS and the others or'd in.
/
To add comments, please log in or register