New to our community ?

Discover a world of possibilities! Join us and explore a vibrant community where ideas flourish and connections thrive.

One of Our Valued Members

Thank you for being part of our community. Your presence enriches our shared experiences. Let's continue this journey together!

Home php codes date calculator between two dates

date calculator between two dates


Welcome Back to, In our previous post we learn find days between two dates using php.
today we will see how to find total number of days between two days using javascript.
days between dates

var oneDay = 24*60*60*1000; // hours*minutes*seconds*milliseconds

var firstDate = new Date(2019,01,26);
var secondDate = new Date(2020,01,26);
var firstDate = new Date(from);
var secondDate = new Date(to);
var diffDays = Math.round(Math.abs((firstDate.getTime() - secondDate.getTime())/(oneDay)));