Skip to content

Instantly share code, notes, and snippets.

@cp-sumi-k
Last active November 8, 2022 09:50
Show Gist options
  • Save cp-sumi-k/14358c647ac0e19b12d6626ca16a4e7c to your computer and use it in GitHub Desktop.
Save cp-sumi-k/14358c647ac0e19b12d6626ca16a4e7c to your computer and use it in GitHub Desktop.
// Current timezone is : Asia/Calcutta
console.log("Current timezone is : " , Intl.DateTimeFormat().resolvedOptions().timeZone)
// Current date in America/Los_Angeles : 11/7/2022, 2:59:43 AM
console.log("Current timezone is : " , cDate.toLocaleString("en-US", { timeZone: "America/Los_Angeles" }))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment