Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

same date to string in javascript minus and days difference

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(diffDays + " days");
 
PREVIOUS NEXT
Tagged: #date #string #javascript #days #difference
ADD COMMENT
Topic
Name
9+2 =