Converts value containing time in seconds that has passed since January 1 in , 1970 , into a string of "yyyy.mm.dd hh:mi:ss" format.
string TimeToStr( datetime value, // value int mode=TIME_DATE|TIME_MINUTES // format );
When in doubt, consult the documentation. You used the word "convert", therefore in the documentation, read-up on "Conversion Functions".
There you will find "TimeToString()" which is the more modern version, compatible with MQL5, which is equivalent to the older name of "TimeToStr()".
string TimeToString( datetime value, // number int mode=TIME_DATE|TIME_MINUTES // output format ); string TimeToStr( datetime value, // value int mode=TIME_DATE|TIME_MINUTES // format );Parameters
value
[in] Time in seconds from 00:00 1970/01/01.
mode=TIME_DATE|TIME_MINUTES
[in] Additional data input mode. Can be one or combined flag:
TIME_DATE gets result as "yyyy.mm.dd",
TIME_MINUTES gets result as "hh:mi",
TIME_SECONDS gets results as "hh:mi:ss".Return Value
String.
FMIC: When in doubt, consult the documentation.
| Bookmark the following |
WHRoeder:
Is that a message for me or for the OP?
FMIC: When in doubt, consult the documentation. | Bookmark the following |
OP
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am writing an Indicator by Trade Function OrderOpenTime() I get the Time in Seconds,
I want to convert the output into a string of "yyyy.mm.dd hh:m:ss" format.
how can I do it?