Answers for "calulate the time between two dates js"

0

get the difference between two dates js

const date1 = new Date('7/13/2010');
const date2 = new Date('12/15/2010');
const diffTime = Math.abs(date2 - date1);
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); 
console.log(diffTime + " milliseconds");
console.log(diffDays + " days");
Posted by: Guest on November-13-2020
-3

calculate time difference between two dates in javascript

Gettings diffrence between daytes
Posted by: Guest on May-26-2021

Code answers related to "calulate the time between two dates js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language