Last active
April 22, 2021 06:43
-
-
Save martinratinaud/77b6093e5b248cc0f621ffce38c1fcf6 to your computer and use it in GitHub Desktop.
Get current user timezone and timezone delay
This file contains hidden or 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 timezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone; // Gives "Indian/Mauritius" | |
const timezoneDelayInMinutes: number = new Date().getTimezoneOffset(); // -240 because of GMT+4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment