Tuesday, September 21, 2021
Calculate date difference using JQuery
Simple way to get days between 2 dates...
var date1 = new Date("12/13/2021"); // MM/dd/yyyy var date2 = new Date("01/01/2021"); // MM/dd/yyyy // date1 - date2 returns difference in milliseconds var diff = new Date(date1 - date2); // get days var days = diff/1000/60/60/24; console.log(days)
‹
›
Home
View web version