Skip to content Skip to sidebar Skip to footer

Javascript: Adding Days To Any Date

I've read through a number of topics now and have not found one quite on point. Here's what I'm trying to do: 1) Parse a bill date that is provided in the format mm/dd/yy and is fr

Solution 1:

Just add the number of days to the date:

var dt= newDate();

dt.setDate(dt.getDate() + 31);

console.log(dt);

Solution 2:

I would suggest taking a look at Datejs (http://www.datejs.com/). I use this library quite a bit to deal with dates, which I find to be a real pain in JS.

Post a Comment for "Javascript: Adding Days To Any Date"