One suspicion. In your system does not used daylight savings time.
GMT+8 Beijing/HongKong dont have DayLight Savings time indeed. Hmm.. seems that this TimeLocal() problem somewhat exists to timezones not using daylight savings time...
Where I can send updated client terminal to determine problem?
#import "kernel32.dll"
void GetLocalTime(int& TimeArray[]);
void GetSystemTime(int& TimeArray[]);
#import
int TimeArray[4];
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start() {
int GMT;
for (int time = TimeLocal() + 15; time > TimeLocal(); ) {
GMT = TimeGMT();
Comment("\nTimeGMT: ", TimeToStr(GMT, TIME_DATE|TIME_SECONDS),
"\nTimeLocal: ",TimeToStr(TimeLocal(),TIME_DATE|TIME_SECONDS) );
Sleep(100);
}
return(0);
}
//+------------------------------------------------------------------+
int TimeGMT() {
GetSystemTime(TimeArray);
int YY=TimeArray[0]&0x0000FFFF;
int MM=TimeArray[0]>>16;
int DD=TimeArray[1]>>16;
int hh=TimeArray[2]&0x0000FFFF;
int mm=TimeArray[2]>>16;
int ss=TimeArray[3]&0x0000FFFF;
return(StrToTime(StringConcatenate(YY,".",MM,".",DD, " ", hh,":",mm,":",ss)));
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Where I can send updated client terminal to determine problem?
GMT+8 Beijing/HongKong dont have DayLight Savings time indeed.
Hmm.. seems that this TimeLocal() problem somewhat exists to timezones not using daylight savings time...
You mean my email address?
You mean my email address?
Yeah. You can send me your e-mail to stringo AT metaquotes DOT ru
Thank You for discovered bug. Please wait for next updated build.
Programming languages like C, Perl have this and MT4 is so much similar to these languages.
As per these codes:
if you use GetSystemTime many times enough, it will no longer return the "seconds" - it stays 0.
I noticed this seconds/minutes before getting disconnected.
In the near future, no. Sorry
I noticed this seconds/minutes before getting disconnected.
More details please
#import "kernel32.dll" void GetLocalTime(int& TimeArray[]); void GetSystemTime(int& TimeArray[]); #import int TimeArray[4]; //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { int GMT; for (int time = TimeLocal() + 15; time > TimeLocal(); ) { GMT = TimeGMT(); Comment("\nTimeGMT: ", TimeToStr(GMT, TIME_DATE|TIME_SECONDS), "\nTimeLocal: ",TimeToStr(TimeLocal(),TIME_DATE|TIME_SECONDS) ); Sleep(100); } return(0); } //+------------------------------------------------------------------+ int TimeGMT() { GetSystemTime(TimeArray); int YY=TimeArray[0]&0x0000FFFF; int MM=TimeArray[0]>>16; int DD=TimeArray[1]>>16; int hh=TimeArray[2]&0x0000FFFF; int mm=TimeArray[2]>>16; int ss=TimeArray[3]&0x0000FFFF; return(StrToTime(StringConcatenate(YY,".",MM,".",DD, " ", hh,":",mm,":",ss))); }And this is the result I "randomly" get:
[img]http://img118.imageshack.us/my.php?image=gmtjm6.swf
[/img]
This occur extremely rare, but this morning (now), I managed to reproduce it many times.