calculations with time

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
henri66
Posts: 1
Joined: 04 Jun 2013 09:23

calculations with time

Post by henri66 » 04 Jun 2013 09:42

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

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: calculations with time

Post by Martin » 09 Jun 2013 14:53

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

Post Reply