MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Conversion functions  TimeToStr

 
Use the opportunities of
MQL5 in MetaTrader 5
Study the new MQL5 language
Study the new MQL5 language.
Reference is already available
string TimeToStr( datetime value, int mode=TIME_DATE|TIME_MINUTES)
Converts value containing time in seconds that has passed since January 1, 1970, into a string of "yyyy.mm.dd hh:mi" format.
Parameters:
value   -   Positive amount of seconds that have passed since 00:00, January 1, 1970.
mode   -   Optional data output mode can be one or combination of:
TIME_DATE gets result as "yyyy.mm.dd",
TIME_MINUTES gets result as "hh:mi",
TIME_SECONDS gets result as "hh:mi:ss".
Sample:
  string var1=TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS);