Created
February 25, 2020 02:29
-
-
Save elzup/81fed3f5be1973bc6aff0ce4b9cfeafc to your computer and use it in GitHub Desktop.
Run setTimeout at become tomorrow
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 nextDay = () => new Date().setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 | |
const tommorowFromNow = () => nextDay() - new Date() | |
setTimeout(() => { | |
// code | |
}, tommorowFromNow()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment