Copy link to clipboard
Copied
Hi,
I'm trying to create a 30 day expiration date for an action.
Start by getting the date on a specific starting date.
var D1:Date = new date;
Add 30 days:
D1.date += 30;
Set up a getDate function:
var D2: date = new date;
How do you compare D1 and D2 as date (not numbers) to check if D2 is more than 30 days greater than D1? Will this work? For example, if today is May 8, then +=30 would be June 7. How to compare that if a date is gotten on June 9, and compared with a stored (SO, for example) May 8, that it is greater (then do something condition)?
if ( D2 > D1) {
//do something
}
Any help appreciated.
saratogacoach
Search Google using "AS3 compare dates" and you should find what you need
Copy link to clipboard
Copied
Search Google using "AS3 compare dates" and you should find what you need
Copy link to clipboard
Copied
Hi Ned,
OOPS. I had searched, but I must not have used the correct search terms. When, following your advice plus specifically using "AS3 compare dates," I searched again, several items showed up.
The first: http://userflex.wordpress.com/2008/09/11/as3-date-compare/ looks promising. I'll see if I can figure it out.
If I run into a problem, I'll write again.
Much thanks.
saratogacoach
Find more inspiration, events, and resources on the new Adobe Community
Explore Now