[Home] >  Date Time >  Get the timezone string

Get the timezone string

JavaScript version

const getTimezone = () => Intl.DateTimeFormat().resolvedOptions().timeZone;

TypeScript version

const getTimezone = (): string => Intl.DateTimeFormat().resolvedOptions().timeZone;

Example

getTimezone(); // 'Asia/Saigon'