Page 1 of 1

Get date 7 days ago

Posted: 17 Apr 2016 01:40
by juantamad
I see that you can get date days in advance but how do you get date at least 7 days back. Thanks

Re: Get date 7 days ago

Posted: 17 Apr 2016 05:41
by MURTUMA
By substracting from current date. Dates are displayed in milliseconds when unformatted, so seven days past would be: "current date - 1000 * 60 * 60 * 24 * 7". Them just format the value, so you'll get human readable date.

Re: Get date 7 days ago

Posted: 17 Apr 2016 07:53
by andy
Or simply use script function adddays(), for example yesterday=adddays(triggertime,-1) returns date of yesterday. triggertime comes from trigger event