In the example below bailout is being set to now + 5mins. Using the Inc[300] method it works correctly, but using +300 I get a number which is between 4:00 and 4:59 ahead of now! If I set myTime to a random int value, all three method sucessfully add 300 (seconds) to it.
Just doing echo ${Math.Calc[${Time.Timestamp}+300]} repeatedly shows that we are getting the same number for an entire minute, where it should be updating every second!
Why does this happen?
Code: Select all
function main()
{
declare myTime int local ${Time.Timestamp}
declare bailout int local
consoleclear
echo now=${myTime}
bailout:Set[${myTime}+300]
echo "5mins=${bailout} (Plus operator)"
bailout:Set[${Math.Calc[${myTime}+300]}]
echo "5mins=${bailout} (Math.Calc)"
bailout:Set[${myTime:Inc[300]}]
echo "5mins=${bailout} (Inc method)"
}
now=1217241352
5mins=1217241600 (Plus operator)
5mins=1217241600 (Math.Calc)
5mins=1217241652 (Inc method)