Download MetaTrader 5

datetime sums

To add comments, please log in or register
Ian Tavener
1347
Ian Tavener  

I'm hoping someone can confirm this for me, since I'm having a difficult time with an EA adjusting for timezones.

if I have a datetime value, and I want to add for example, 3 hours to that time, could I use this?

datetime RightNow=TimeCurrent();
int Adjust=3; //3 hours adjust
datetime Future=RightNow+(Adjust*60*60);

 Thanks for your help!

Alain Verleyen
Moderator
35110
Alain Verleyen  
imtav:

I'm hoping someone can confirm this for me, since I'm having a difficult time with an EA adjusting for timezones.

if I have a datetime value, and I want to add for example, 3 hours to that time, could I use this?

 Thanks for your help!

Yes.
To add comments, please log in or register