-
-
Save kironroy/0de946455a5ed487b3e59bc147feb035 to your computer and use it in GitHub Desktop.
date operators
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
const calcdaysPassed = (date1, date2) => | |
Math.abs((date2 - date1) / (1000 * 60 * 60 * 24)); | |
const days1 = calcdaysPassed(new Date(2037, 3, 4), new Date(2037, 3, 14)); | |
console.log(days1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment