Created
February 21, 2023 08:38
-
-
Save pointofpresence/990e4b079f6aaa4e7d379e292589f269 to your computer and use it in GitHub Desktop.
Quote of the day
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 dtNow = new Date(); | |
const intTZOffset = dtNow.getTimezoneOffset() * 60000; // automatically adjust for user timezone | |
const intNow = dtNow.getTime() - intTZOffset; | |
const intDay = Math.floor(intNow / 86400000); // The number of 'local' days since Jan 1, 1970 | |
const randomIndex = intDay % QuotesData.length; | |
const item = QuotesData[randomIndex]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment