I want to add a date to the current DateTime in JavaScript, what should I do? Is there a function that JavaScript uses like AddDay on the dot net?
javascript date
Well, I think you can make it like this and use it.
Date.prototype.addDays = function(days)
{
var dat = new Date(this.valueOf());
dat.setDate(dat.getDate() + days);
return dat;
}
var dat = new Date();
alert(dat.addDays(5))
© 2024 OneMinuteCode. All rights reserved.