English

## How do I add/subtract from time?

 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? similar
2568
Roger 2008.12.10 05:20 #

 TimeCurrent( )
is counted in seconds. So your time:
`datetime yourtime=TimeCurrent()-2*3600;//or 3*3600`
 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.
 108 eddie 2015.09.03 11:34 #   The key concept is "is counted in seconds".Then do basic math.
 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
 Moderator3416 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.ThanksYou have been shown how to subtract 2 or 3 hours. Isn't adding so many hours obvious?
 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 hourswith Thanks and Regards
 Moderator3416 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 hourswith Thanks and RegardsIf 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.