Add a date to a date in Actionscript 2
I needed to work out a date range according to the date 3weeks away from the current date.
After a bit of thinking, I found that it’s actually quite easy to achieve.
|
|
The above code gets the current date and adds 21days/3weeks to it.
Remember that if you use getMonth to output the final month number, you will want to add 1 to it as it starts at 0;
Example:
dateMonth2 = theDate2.getMonth()+1;
So you would do it like this:
theDate2.getDate() +"/"+ (theDate2.getMonth()+1) +"/"+ theDate2.getFullYear();