Quantcast
Channel: How do I get the difference between two Dates in JavaScript? - Stack Overflow
Viewing all articles
Browse latest Browse all 20

Answer by Liam Pillay for How do I get the difference between two Dates in JavaScript?

$
0
0

To get the date difference in milliseconds between two dates:

var diff = Math.abs(date1 - date2);

I'm not sure what you mean by converting the difference back into a date though.


Viewing all articles
Browse latest Browse all 20

Latest Images

Trending Articles

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>