If you ever have to work with timezones in JavaScript, you can use Intl.DateTimeFormat
to get the IANA timezone of the user:
const timeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
// Result: "Europe/Zurich"
If you ever have to work with timezones in JavaScript, you can use Intl.DateTimeFormat
to get the IANA timezone of the user:
const timeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
// Result: "Europe/Zurich"