Adding minutes to a Timestamp

Contains tips for configurators working with Aware IM
Post Reply
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Adding minutes to a Timestamp

Post by BobK »

Maybe this is common knowledge, but I just figured it out.

The TIME_ADD function is usually used to add hours to a Timestamp.

But it can also be used to add minutes. Just use a fraction for the second parameter.

For example, to add 1 minute to a Timestamp do the following:
TIME_ADD(theTimeStamp,0.166667)

I am not sure what precision is necessary or best.
Bob
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Post by BobK »

oops, I misplaced the decimal point. The above will add 10 minutes.
To add just 1 minute it should be:

TIME_ADD(theTimeStamp,0.016667)
Bob
Rennur
Posts: 1191
Joined: Thu Mar 01, 2012 5:13 am
Location: Sydney, Australia

Post by Rennur »

Subtracting doesn't work for me, any suggestions?

eg.
TIME_ADD(theTimeStamp,-0.166667)

http://www.awareim.com/forum/viewtopic.php?t=7156

Cheers
Post Reply