Skip to content

Function: getLocalTimezone()

ts
function getLocalTimezone(): string;

Local IANA time zone from Intl (e.g. Asia/Shanghai). 通过 Intl 获取本地 IANA 时区名。

Returns

string

IANA zone id / IANA 时区字符串

Example

ts
getLocalTimezone() // => 例如 'Asia/Shanghai' 或 'America/New_York'

Since

1.0.0

Released under the MIT License.