# How do I add/subtract from time?

19

I would like to be able to subtract 2-3 hours from the current time. What's the formula to do this?
2441

 TimeCurrent( )
is counted in seconds. So your time:
`datetime yourtime=TimeCurrent()-2*3600;//or 3*3600`
360

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

with Thanks and regards.

157

The key concept is "is counted in seconds".

Then do basic math.

360

@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

Moderator
10614

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?
360

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

Moderator
10614

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.