A bug with StrToTime function - page 2

 
I agree it would seem natural that the function StrToTime("17:35") would look at the local time when the call is made, drop its hour and minute and second components, and patch in the hour "17" and minute "35", all in the internal datetime representation. A reasonable alternative, perhaps better even, would be that it uses the server time (and simulated server time during testing) at the time of call, but in any case that it sets the date component dynamically from a time reading at the time of call.

As I understand stringo, the date component is supposedly taken from the compilation time. But that doesn't gel with Milan's observation that the result is different at one call from another (assuming the same executable -- same compilation -- was used).

Of course, you would get different results at your times 00:33 and, say, 04:28 if there is a date shift in the time zone that StrToTime uses between those two times. Milan, perhaps that is/was the cause of your observation? I think it would be good to document which time zone StrToTime works in.
 
Milan, You are right about string constant. But I cannot reproduce described bug.
 
exactly, richplank.
Stringo, it is simple to try it. Simply attach my EA StrToTime.mq4 to any chart before 1 o'clock, watch on comment and wait for time after 1. At 1:00 there will change date on comment. I state, it should change at 0:00.
P.S. I live in CET timezone and my broker time is in CET too. So, regardless to which time is StrToTime associated (either broker or local), it changes improperly.
 
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.
 
I would venture a guess, that StrToTime actually uses UTC, which is one hour behind CET (http://www.timeanddate.com/library/abbreviations/timezones/eu/cet.html).
Then the date shift of StrToTime would happen when CET goes from 00:59 to 01:00.
 
stringo:
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.
CET is currently GMT+1. In summer there is DST correction, so in summer it is GMT+2.
Reason: