Finding the date 5 days ago

Post your questions and help other users.

Moderator: Martin

Post Reply
Smgcircle
Posts: 2
Joined: 05 Jan 2014 13:48

Finding the date 5 days ago

Post by Smgcircle » 05 Jan 2014 18:35

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.

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

Re: Finding the date 5 days ago

Post by Martin » 06 Jan 2014 17:23

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

Smgcircle
Posts: 2
Joined: 05 Jan 2014 13:48

Re: Finding the date 5 days ago

Post by Smgcircle » 06 Jan 2014 18:58

Hi Martin,

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

Steve

Post Reply