Created
February 25, 2019 12:16
-
-
Save servatj/0e13d8ca59d7523219b181029a69287e to your computer and use it in GitHub Desktop.
Get the number of days between to days in JS
This file contains hidden or 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
var oneDay = 24*60*60*1000; // hours*minutes*seconds*milliseconds | |
var firstDate = new Date(2018,08,13); | |
var secondDate = new Date(2019,02,25); | |
var diffDays = Math.round(Math.abs((firstDate.getTime() - secondDate.getTime())/(oneDay))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment