Download MetaTrader 5

datetime sums

To add comments, please log in or register
Write articles, help other developers and make money
Ian Tavener
1169
Ian Tavener 2015.03.13 18:30 

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
30713
Alain Verleyen 2015.03.13 18:37  
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