Download MetaTrader 5

TimeGMT() function

To add comments, please log in or register
Do you have questions on how to turn your idea into reality? Ask them on the Forum!
BPASoftware Thai Co. Ltd
6400
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 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. 

Documentation on MQL5: Date and Time / TimeGMT
  • www.mql5.com
Date and Time / TimeGMT - Documentation on MQL5
To add comments, please log in or register