You can change the date using setDate . It automatically adjusts the transition to new months / years, etc.
var oneWeekAgo = new Date(); oneWeekAgo.setDate(oneWeekAgo.getDate() - 7);
Then go to the date of the string anyway you prefer.
David Hedlund Dec 13 '11 at 12:50 2011-12-13 12:50
source share