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
but u have to use "yyyy.mm.dd hh:mm" format otherwise u get error 4051
StrToTime
Converts string in the format "yyyy.mm.dd hh:mi" to datetime type (the amount of seconds that have passed since 1 Jan., 1970).
datetime StrToTime(
string value // string
);
Parameters
value
[in] Строка в формате "yyyy.mm.dd hh:mi ".
Returned value
Value of datetime type as a number of seconds, passed since 01.01.1970.
Example:
datetime var1,var2,var3;
var1=StrToTime("2003.8.12 17:35");
var2=StrToTime("17:35"); // returns the current date with the given time
var3=StrToTime("2003.8.12"); // returns the date with the midnight time of "00:00"
OK, you are correct, either the help in MetaEditor is wrong or there is a bug, either way it need to be reported to the Service Desk I'll report it . . . and the russian in the English help.
This will work as a workaround giving the same result . . .
. . and no error.
. . and no error.
of course, it's the right format
what are you talking about?
gives
so what is wrong?
what are you talking about?
gives
so what is wrong?
what are you talking about?
gives
so what is wrong?
add GetLastError() u will find out
StrToTime() not StringToTime()
doesn't matter both are giving error 4051
GetLastError() gives description of error only if it happened and only if the function is using error handler.
This is no the case here, so using it has no sense.
Str vs. String, you should use the new functions as they are same as in MQL5, to have source compatibility.
Also if the results is as documented, why are you insisting on error?
GetLastError() gives description of error only if it happened and only if the function is using error handler.
This is no the case here, so using it has no sense.
Str vs. String, you should use the new functions as they are same as in MQL5, to have source compatibility.
Also if the results is as documented, why are you insisting on error?
Str vs. String, you should use the new functions as they are same as in MQL5, to have source compatibility.