Created
October 7, 2017 08:49
-
-
Save buiquangduc/fb5bc343f2ee683fa85f165944aab9d5 to your computer and use it in GitHub Desktop.
Get the range from date to date with 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
var oneDay = 24*60*60*1000; // hours*minutes*seconds*milliseconds | |
var firstDate = new Date(2008,01,12); | |
var secondDate = new Date(2008,01,22); | |
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