Created
September 24, 2022 18:19
-
-
Save Avaray/12854152d7d9bda9efa080b485dc74b6 to your computer and use it in GitHub Desktop.
Calculate Days / Hours / Minutes / Seconds between two dates in JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// days between | |
(b - a) / (1000 * 60 * 60 * 24) | |
// minutes between | |
(b - a) / 60000 | |
// seconds between | |
(b - a) / 1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment