I found a millisecond approach a while back that hasn't given us any issues
yet

604800000 milliseconds in a week is the fact I base the code on.

var date:Date = new Date(YYYY, MM, DD);

Datetime lastyear = date.setMilliseconds(date.milliseconds - 604800000 * 52);




On Tue, May 8, 2018 at 8:07 AM, Richard Kaye <[email protected]> wrote:

> While doing my due diligence on the subject I thought I’d toss it out here
> in case someone already has a function handy that will do this, thus saving
> me the effort of thinking too hard too early in the day. 😉
>
> Here’s the goal. I want to take a date, say today, Tuesday May 8, 2018 and
> figure out how to return Tuesday, May 9, 2017 or Tuesday May 10, 2016, etc.
> This is so I can do some year over year comparisons to transactions that
> occurred on the same day of the week a year ago.
>
> TIA
>
> --
>
> rk
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cajidmykf_pvkbd1-jypfs_znfpkaehjykrm9ofvuj0uyxsk...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to