Page 1 of 1

Finding the date 5 days ago

Posted: 05 Jan 2014 18:35
by Smgcircle
Hi everyone!

I have just purchased Automagic and this is my first post here.

I'm trying to find a way to use getDate() (or any other function) to find the date 5 days ago.

Any help would certainly be appreciated!

Thanks.

Re: Finding the date 5 days ago

Posted: 06 Jan 2014 17:23
by Martin
Hi

A date in Automagic is stored as the number of milliseconds since 1970. You can use regular +/- operations to modify a date or use the addDays function:
d = addDays(getDate(), -5);
or
d = getDate() - 5*24*60*60*1000;

Regards,
Martin

Re: Finding the date 5 days ago

Posted: 06 Jan 2014 18:58
by Smgcircle
Hi Martin,

This is exactly what I needed. Thanks so much for your help.

Steve