Created
July 28, 2023 10:26
-
-
Save ivuorinen/5733c65dc1d78170cbf4bf0fc92720eb to your computer and use it in GitHub Desktop.
Minutes since midnight
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 minutesSinceMidnight = () => { | |
const now = new Date(); | |
const midnight = new Date().setHours(0, 0, 0, 0); | |
return ((now - midnight) / 1000) / 60; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment