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 time:Civil value to an time:Utc timestamp based on the time zone value.

utcToCivil

Converts a given time:Utc timestamp to a time: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 time:Civil value to an time:Utc timestamp based on the time zone value.

Parameters

  • civil Civil
  • time:Civil time

Return Type

(Utc | Error)

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

utcToCivil

function utcToCivil(Utc utc) returns Civil
Isolated Function

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

Parameters

  • utc Utc
  • time:Utc timestamp

Return Type

(Civil)

The corresponding time:Civil value