Answers for "js add time to date"

12

javascript add minutes to date

//add 30 minutes to date
var minutesToAdd=30;
var currentDate = new Date();
var futureDate = new Date(currentDate.getTime() + minutesToAdd*60000);
Posted by: Guest on July-31-2019
9

javascript add day to date

function addDays(date, days) {
  var result = new Date(date);
  result.setDate(result.getDate() + days);
  return result;
}
Posted by: Guest on May-17-2020
2

how to add date in java script

var someDate = new Date();
var numberOfDaysToAdd = 6;
someDate.setDate(someDate.getDate() + numberOfDaysToAdd);
Posted by: Guest on May-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language