TimeGMT() function New comment Bruno Paulet 2012.07.21 12:51 I have a bug on TimeGMT() function, the returned time is 1 hour more than real GMT time.I'm at Bkk at this time (GMT +7), no summer time. However TimeGMTOffset() return the good valueI solve the problem by this function : datetime NewTimeGMT( MqlDateTime &dt ){ datetime now = TimeLocal(); now += TimeGMTOffset(); TimeToStruct( now, dt ); return now;} An idea ?Thanks. Documentation on MQL5: Date and Time / TimeGMT www.mql5.com Date and Time / TimeGMT - Documentation on MQL5 TimeLocal TimeCurrent Discussion of article "Why Virtual Hosting On The MetaTrader 4 And MetaTrader 5 Is Better Than Usual VPS" Set timeZone UTC New comment
I have a bug on TimeGMT() function, the returned time is 1 hour more than real GMT time.
I'm at Bkk at this time (GMT +7), no summer time.
However TimeGMTOffset() return the good value
I solve the problem by this function :
datetime NewTimeGMT( MqlDateTime &dt )
{
datetime now = TimeLocal();
now += TimeGMTOffset();
TimeToStruct( now, dt );
return now;
}
An idea ?
Thanks.