Page 1 of 1

calculations with time

Posted: 04 Jun 2013 09:42
by henri66
is it possible to calculate with times?

for example: getDate() - triggertime (to test in an if-Statement whether the result is bigger then 10 minutes)

thanks

Re: calculations with time

Posted: 09 Jun 2013 14:53
by Martin
Hi,

The function getDate and triggertime return the number of milliseconds since 1970. You can directly use the values to calculate the difference:

diff = getDate() - triggertime;
if(diff>10*60*1000)
{
...
}

Regards,
Martin