Page 1 of 1

date math - subtract 7 hours ?

Posted: Thu May 29, 2008 4:20 pm
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!

date math - subtract 7 hours ?

Posted: Thu May 29, 2008 4:55 pm
by mark
<$sevenhours=(60*60*7)>
<$inoutdate=(convert($inoutdate, 'date' )-$sevenhours)>