Date Difference - Days


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var date1 = new Date("10/13/1975");
  2. var date2 = new Date("10/14/1979");
  3.  
  4. var date_diff = Math.abs(date2.getTime() - date1.getTime())/86400000;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.