mercredi 29 septembre 2021

I want to make if condition between two dates difference

const today = new Date();
var date2 = new Date("10/29/2021");

var Difference_In_Time = date2.getTime() - today.getTime();

var Difference_In_Days = Difference_In_Time / (1000 * 3600 * 24);

document.write(
  "Total number of days between dates  <br>" +
  today +
  "<br> and <br>" +
  date2 +
  " is: <br> " +
  Difference_In_Days
);

Aucun commentaire:

Enregistrer un commentaire