Does anybody know of an easy way of taking a date (e.g. Today) and going back X days?
So, for example, if I want to calculate the date 5 days before today.
Does anybody know of an easy way of taking a date (e.g. Today) and going back X days?
So, for example, if I want to calculate the date 5 days before today.
If you're performing lots of headachy date manipulation throughout your web application, DateJS will make your life much easier:
http://simonwillison.net/2007/Dec/3/datejs/
The top answers led to a bug in my code where on the first of the month it would set a future date in the current month. Here is what I did,
A easy way to manage dates is use Moment.js
You can use
add
. ExampleDocs http://momentjs.com/docs/#/manipulating/add/