How do I add/subtract from time?

Back to topics list To post a new topic, please log in or register
avatar
3
SystemTrading 2008.12.10 05:03
 
I would like to be able to subtract 2-3 hours from the current time. What's the formula to do this?
 
avatar
2568
Roger 2008.12.10 05:20 #
 
TimeCurrent( )
is counted in seconds. So your time:
datetime yourtime=TimeCurrent()-2*3600;//or 3*3600
avatar
54
d.saravana21 2015.09.03 06:36 #
 

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


with Thanks and regards.

avatar
108
eddie 2015.09.03 11:34 #
 

The key concept is "is counted in seconds".

Then do basic math.


avatar
54
d.saravana21 2015.09.03 13: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

avatar
Moderator
3416
GumRai 2015.09.03 14: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?
avatar
54
d.saravana21 2015.09.03 14: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

avatar
Moderator
3416
GumRai 2015.09.03 14: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.
Back to topics list  

To add comments, please log in or register