Last active
January 26, 2024 16:52
-
-
Save ryanmorr/7ae4e40fc6937b891e5f4d44110f3a8e to your computer and use it in GitHub Desktop.
Get the timezone of the client
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
// Get the IANA timezone | |
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; | |
// My result | |
console.log(timezone); //=> "America/Toronto" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment