Answers for "nodejs date add days"

2

javascript date add days

function addDays(originalDate, days){
  cloneDate = new Date(originalDate.valueOf());
  cloneDate.setDate(cloneDate.getDate() + days);
  return cloneDate;
}

let appointment = new Date("February 12, 2021 00:00:00");
let newAppointment = addDays(appointment, 7);

console.log(appointment.getDate()); // 12
console.log(newAppointment.getDate()); // 19
Posted by: Guest on February-28-2021
-1

nodejs date add days

date.setTime( date.getTime() + days * 86400000 );
Posted by: Guest on November-08-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language