Is something wrong with StrToTime function?

 

Hello,


I'm trying to build an EA based on a specific trading time.

string TimeEntry = "10:30:00";

But it's not working.


And this simple code :

int start=StrToTime(TimeEntry);

returning 23 when I put it in :

Alert(TimeDay(start));

while the code below returning 22

Alert(TimeDay(TimeCurrent()));


Does the StrToTime function should returning the current day date value (22) if inserted to a TimeDay() function? I've change the "start" variable from "int" to datetime" and it's still returning the same value.

I'm using ODL's MT4 v 218, am I doing something wrong?


Thank you

 

I think I understand what's wrong. The StrToTime doesn't work exactly like the Metaquotes description :

  datetime var1;
  var1=StrToTime("2003.8.12 17:35");
  var1=StrToTime("17:35");      // returns the current date with the given time
  var1=StrToTime("2003.8.12");  // returns the date with the midnight time of "00:00"

This was Stringo's reply on another thread (https://forum.mql4.com/5134):

stringo wrote >>
Milan, is your local time GMT+2? I don't know what means CET timezone exactly. And what is your daylight savings correction?
 
StrToTime uses gmtime if date missing. Obtained datetime value corrected with timezone value.

So Why there's no addition to the StrToTime's description for almost 2 years? Just a suggestion.


Thanks