Created
October 8, 2015 07:45
-
-
Save johanbove/f9632e16c5bd9e70ac31 to your computer and use it in GitHub Desktop.
Minutes between end and start
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 start = new Date(new Date().setMinutes(45)); | |
var end = new Date(new Date().setMinutes(15)); | |
minutesBetweenEndStart = Math.abs(end.getTime() - start.getTime()) / 1000 / 60; | |
console.assert(minutesBetweenEndStart === 30, "minutesBetweenEndStart should be 30"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment