Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

difference between two dates in js

var d1 = new Date("08/14/2020"); 
var d2 = new Date("09/14/2020"); 
  
var diff = d2.getTime() - d1.getTime(); 
  
var daydiff = diff / (1000 * 60 * 60 * 24); 
document.write(daydiff + " days" ); 
Source by www.javatpoint.com #
 
PREVIOUS NEXT
Tagged: #difference #dates #js
ADD COMMENT
Topic
Name
3+4 =