const date = new Date() | |
const formatOptions = { | |
hour12: false, | |
hour: "2-digit", | |
minute: "2-digit", | |
second: "2-digit" | |
} | |
const dtVolgograd = new Intl.DateTimeFormat("en-US", { | |
...formatOptions, | |
timeZone: "Europe/Volgograd" | |
}).format(date) | |
const dtMoscow = new Intl.DateTimeFormat("en-US", { | |
...formatOptions, | |
timeZone: "Europe/Moscow" | |
}).format(date) | |
console.log(dtVolgograd === dtMoscow) // `true` expected |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment