$getNativeTimeZoneName
Retrieve the local system's current timezone name.
$getNativeTimeZoneName()
Retrieves the local system's current timezone name, falling back to its IANA timezone identifier if the name cannot be determined.
Signature
$getNativeTimeZoneName(tzId?: $TimeZoneIdentifier): LooseLiteral<TimeZoneNameNative | $TimeZoneIdentifier>Parameters
tzIdOptional time zone identifier to get time zone name for that identifier.
Return Type
LooseLiteral<TimeZoneNameNative | $TimeZoneIdentifier>- The resolved timezone name or IANA identifier as fallback
Example
playground.ts
Remarks
- Always reflects the local machine's timezone name regardless of whether
timeZone(),utc(), ortoUTC()methods have been applied - For modified instances, use the
timeZoneNamepublic property instead to get the current instance's timezone context - Uses
Intl.DateTimeFormatwithtimeZoneName: 'long'to resolve the display name - Falls back to the IANA identifier when no display name can be determined
Usage Notes
playground.ts
Last updated: Thu, May 21, 2026 03:51:36PM (UTC)
