date math - subtract 7 hours ?

Post Reply
nduvnjak
Posts: 40
Joined: Wed Feb 06, 2008 3:45 pm

date math - subtract 7 hours ?

Post by nduvnjak »

might sound like simple and basic thing, but I don't know how to get the date-time value which is 7 hours before the given date. (in vortex script)
Let's say I have the date in STRING variable:
"2008-05-27 23:44:12"
I would like to calculate the exact date-time value 7 hours before that, and return it as a date or string type, doesn't matter.

This, for example doesn't work:
<$inoutdate = '2008-05-27 23:44:12'>
<sum "%s" $inoutdate ' - 7 hours'>
<$inoutdate=(convert($ret, 'date'))>

Tried couple of other things, but still no clue.
Please help, thanks a lot!
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

date math - subtract 7 hours ?

Post by mark »

<$sevenhours=(60*60*7)>
<$inoutdate=(convert($inoutdate, 'date' )-$sevenhours)>
Post Reply