Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

30 day expiration date

Contributor ,
May 08, 2013 May 08, 2013

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

TOPICS
ActionScript
814
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 08, 2013 May 08, 2013

Search Google using "AS3 compare dates" and you should find what you need

Translate
LEGEND ,
May 08, 2013 May 08, 2013

Search Google using "AS3 compare dates" and you should find what you need

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 08, 2013 May 08, 2013
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines