ejmin ejoni:
hi all, i want invert date and time to secounds since from 1/1/1970, but it gives me error , for example i wrote Print("sall" StrToTime(2021.02.05 05:05)); on void onTick, but it gives me error like .05 some operator expected, and 05 unexpected token?
whats the problem?
What do you mean by "invert"?
StrToTime uses a string parameter, you are using a datetime format.
Use TimeToString().
Keith Watford:
What do you mean by "invert"?
StrToTime uses a string parameter, you are using a datetime format.
Use TimeToString().
is there any way to convert datetime to secounds from 1/1/1970 directly?
ejmin ejoni:
is there any way to convert datetime to secounds from 1/1/1970 directly?
try
datetime time=D'2021.02.05'; int seconds=(int)time;
Keith Watford:
thanks it works
try
ejmin ejoni: whats the problem?
Print("sall" StrToTime( 2021.02.05 05:05 )); ^__________ ___________^__________ no operation (plus sign to append) ^_____ __________ a.b.c is not a valid number. ^________ a:b is not a valid number. ^________________^_____ StrToTime requires a string. (quotes)

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
hi all, i want invert date and time to secounds since from 1/1/1970, but it gives me error , for example i wrote Print("sall" StrToTime(2021.02.05 05:05)); on void onTick, but it gives me error like .05 some operator expected, and 05 unexpected token?
whats the problem?