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

0

Welcome Back to shortlearner.com, 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

<script>
      
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)));

alert(diffDays);
</script>