TImeCurrent() returns a datetime, so you don't have to use a StringToTime() function, it's already a (date)time.
If you want to format your output you have to use TimeToString(). See documentation.
Print(TimeToString( TimeCurrent()), " ", StringToTime(TimeCurrent()) );
my code for testing
the result
i dont see that much difference
Comment((long)TimeCurrent());
Thanks Kypa
i dont understand why i have to put long in front but it works
amando
kypa:
I see now I misread the question.
Because 1970 was a long, long time ago. :D
datetime and long are both big integers, terminal translates datetime in human-friendly form. This way you command it show it as the big integer it is, without the translation.
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
Hello,
i want to know the actual time in sekonds since 1970 as its written also here in the output format
https://www.mql5.com/en/docs/convert/stringtotime
i try to use
but as output in the terminal i always get the format
YYYY.MM.DD hh.mm.ss
does i do something wrong or is there an mistake in the documentation?
amando