Increment Date in Javascript
Following is the function to increment date by one day in javascript.
function IncrementDate(date) {
var tempDate = new Date(date);
tempDate.setDate(tempDate.getDate() + 1);
return tempDate;
}
Function calling...
var currentDate = new Date();
var IncrementedDate = IncrementDate(currentDate);
Here we use the setDate method of Date variable to increment date.
For exploring more in programming on this blog click here
Following is the function to increment date by one day in javascript.
function IncrementDate(date) {
var tempDate = new Date(date);
tempDate.setDate(tempDate.getDate() + 1);
return tempDate;
}
Function calling...
var currentDate = new Date();
var IncrementedDate = IncrementDate(currentDate);
Here we use the setDate method of Date variable to increment date.
For exploring more in programming on this blog click here
0 comments:
Post a Comment
Click to see the code!
To insert emoticon you must added at least one space before the code.