Class: TimeZone

Read Only

Localized time zone implementation to handle time zones.

Constructor

Initialize a TimeZone class using a zone ID.

init (string? zoneId)
  • zoneId string? ()
  • Zone ID as a string or nil to initialize a TimeZone object with the system default time zone

Methods

fixedOffset

If always at a fixed offset from Utc, then this function returns it; otherwise nil.

utcFromCivil

Converts a given Civil value to an Utc timestamp based on the time zone value.

utcToCivil

Converts a given Utc timestamp to a Civil value based on the time zone value.

Fields

  • Fields Included from * & readonly
    • readonly

fixedOffset

function fixedOffset() returns ZoneOffset?
Isolated Function

If always at a fixed offset from Utc, then this function returns it; otherwise nil.

Return Type

(ZoneOffset?)

The fixed zone offset or nil

utcFromCivil

function utcFromCivil(Civil civil) returns Utc | Error
Isolated Function

Converts a given Civil value to an Utc timestamp based on the time zone value.

Parameters

Return Type

(Utc | Error)

The corresponding Utc value or an error if civil.timeAbbrev is missing

utcToCivil

function utcToCivil(Utc utc) returns Civil
Isolated Function

Converts a given Utc timestamp to a Civil value based on the time zone value.

Parameters

  • utc Utc
  • Utc timestamp

Return Type

(Civil)

The corresponding Civil value