Download MetaTrader 5
To add comments, please log in or register
Search in documentation is available via MetaTrader 5. Search and learn!
Tyler Moore
19
Tyler Moore 2008.12.10 04:03 
I would like to be able to subtract 2-3 hours from the current time. What's the formula to do this?
Alexander
2441
Alexander 2008.12.10 04:20  
TimeCurrent( )
is counted in seconds. So your time:
datetime yourtime=TimeCurrent()-2*3600;//or 3*3600
Saravanakumar D
357
Saravanakumar D 2015.09.03 04:36  

Nice work bro.. How to add 2 and half or 3 and half.


with Thanks and regards.

peter.MT4Web
158
peter.MT4Web 2015.09.03 09:34  

The key concept is "is counted in seconds".

Then do basic math.

Saravanakumar D
357
Saravanakumar D 2015.09.03 11:44  

@eddie... i can also do the same message to all the topic bro.. if i know the code why do i ask here?..

Kindly put code as @Roger say's.


Thanks

Keith Watford
Moderator
7985
Keith Watford 2015.09.03 12:00  
d.saravana21:

@eddie... i can also do the same message to all the topic bro.. if i know the code why do i ask here?..

Kindly put code as @Roger say's.


Thanks

You have been shown how to subtract 2 or 3 hours. Isn't adding so many hours obvious?
Saravanakumar D
357
Saravanakumar D 2015.09.03 12:25  

Oops... I found my self.. Now a day's it's hard to have help from this forum peoples.. it was nice and cool before 2010..any way have happy and healthy life brother...

it's like  mytime+2.5*3600; //3.5*3600 for 3 and half hours

with Thanks and Regards

Keith Watford
Moderator
7985
Keith Watford 2015.09.03 12:52  
d.saravana21:

Oops... I found my self.. Now a day's it's hard to have help from this forum peoples.. it was nice and cool before 2010..any way have happy and healthy life brother...

it's like  mytime+2.5*3600; //3.5*3600 for 3 and half hours

with Thanks and Regards

If you get spoon-fed the total answer, you learn nothing. If you are given an answer that forces you to use your own brain a little, you learn.
/
To add comments, please log in or register