of

actual fun of(zoneId: String): TimeZone(source)
expect fun of(zoneId: String): TimeZone(source)

Returns the time zone identified by the provided zoneId.

The supported variants of time zone identifiers:

  • Z, 'UTC', 'UT' or 'GMT' — identifies the fixed-offset time zone TimeZone.UTC,

  • a string starting with '+', '-', UTC+, UTC-, UT+, UT-, GMT+, GMT- — identifiers the time zone with the fixed offset specified after + or -,

  • all other strings are treated as region-based zone identifiers. In the IANA Time Zone Database (TZDB) which is used as the default source of time zones, these ids are usually in the form area/city, for example, Europe/Berlin or America/Los_Angeles.

Throws

if zoneId has an invalid format or a time-zone with the name zoneId is not found.

actual fun of(zoneId: String): TimeZone(source)
actual fun of(zoneId: String): TimeZone(source)