ChronosChronos

$getNativeTimeZoneId

Retrieve the local system's current timezone identifier.

$getNativeTimeZoneId()

Retrieves the IANA timezone identifier for the local system's current timezone.

Signature

$getNativeTimeZoneId(): TimeZoneIdNative

Return Type

  • TimeZoneIdNative - The local system's IANA timezone identifier

Example

playground.ts

Remarks

  • Always returns the local machine's timezone identifier regardless of whether timeZone(), utc(), or toUTC() methods have been applied
  • For modified instances, use the timeZoneId public property instead to get the current instance's timezone context
  • Directly accesses Intl.DateTimeFormat().resolvedOptions().timeZone for the system identifier
  • Returns standardized IANA timezone identifiers (e.g., "Asia/Dhaka", "America/New_York")

Usage Notes

playground.ts

Last updated: Thu, May 21, 2026 03:51:36PM (UTC)

On this page