core / io.islandtime / TimeZone

TimeZone

(iosArm64, iosX64, jvm, macosX64) sealed class TimeZone : Comparable<TimeZone>

A time zone.

Types

(iosArm64, iosX64, jvm, macosX64)

FixedOffset

A time zone defined by a fixed offset from UTC.

class FixedOffset : TimeZone
(iosArm64, iosX64, jvm, macosX64)

Region

A named time zone, typically corresponding to a region identifier in the IANA Time Zone Database, but may be any name that can be understood by a TimeZoneRulesProvider.

class Region : TimeZone

Properties

(iosArm64, iosX64, jvm, macosX64)

id

An ID that uniquely identifies the time zone.

abstract val id: String
(iosArm64, iosX64, jvm, macosX64)

isValid

Check if this is a valid time zone according to the current time zone rules provider.

abstract val isValid: Boolean
(iosArm64, iosX64, jvm, macosX64)

rules

Get the rules associated with this time zone.

abstract val rules: TimeZoneRules

Functions

(iosArm64, iosX64, jvm, macosX64)

compareTo

open fun compareTo(other: TimeZone): Int
(iosArm64, iosX64, jvm, macosX64)

normalized

Get a normalized time zone.

abstract fun normalized(): TimeZone
(iosArm64, iosX64, jvm, macosX64)

toString

open fun toString(): String
(iosArm64, iosX64, jvm, macosX64)

validate

Check if the time zone is valid and throw an exception if it isn't.

fun validate(): Unit
(iosArm64, iosX64, jvm, macosX64)

validated

Ensure that the time zone is valid, throwing an exception if it isn't.

fun validated(): TimeZone

Companion Object Properties

(iosArm64, iosX64, jvm, macosX64)

UTC

A fixed time zone representing UTC.

val UTC: TimeZone

Companion Object Functions

(iosArm64, iosX64, jvm, macosX64)

FixedOffset

fun FixedOffset(id: String): TimeZone

Extension Functions

(jvm)

toJavaZoneId

fun TimeZone.toJavaZoneId(): ZoneId

Inheritors

(iosArm64, iosX64, jvm, macosX64)

FixedOffset

A time zone defined by a fixed offset from UTC.

class FixedOffset : TimeZone
(iosArm64, iosX64, jvm, macosX64)

Region

A named time zone, typically corresponding to a region identifier in the IANA Time Zone Database, but may be any name that can be understood by a TimeZoneRulesProvider.

class Region : TimeZone