Skip to content

//core/io.islandtime/TimeZone/FixedOffset

FixedOffset

class FixedOffset : TimeZone

A time zone defined by a fixed offset from UTC.

In general, region-based time zones are preferred, but there are situations where only a fixed offset may be available.

Parameters

common

offset a valid UTC offset

Throws

DateTimeException if offset is outside the valid range

Properties

Name Summary
id

common


open override val id: String

An ID that uniquely identifies the time zone.
isValid

common


open override val isValid: Boolean

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

common


val offset: UtcOffset
rules

common


open override val rules: TimeZoneRules

The rules associated with this time zone.

Functions

Name Summary
compareTo

common


open operator override fun compareTo(other: TimeZone): Int
displayName

common


fun displayName(style: TimeZoneTextStyle, locale: Locale): String

A textual representation of this time zone, suitable for display purposes. The localized name will be returned, if available for the locale in the specified style. If not, the id will be returned instead.
equals

common


open operator override fun equals(other: Any?): Boolean
hashCode

common


open override fun hashCode(): Int
localizedName

common


fun localizedName(style: TimeZoneTextStyle, locale: Locale): String?

The localized name of this time zone, if available for the locale in the specified style. The result depends on the configured TimeZoneTextProvider and may differ between platforms.
normalized

common


open override fun normalized(): TimeZone.FixedOffset

Returns a normalized time zone, converting any zone with a fixed offset to use a consistent identifier.
toJavaZoneId

jvm


fun TimeZone.toJavaZoneId(): ZoneId

Converts this time zone to an equivalent Java ZoneId.
toNSTimeZone

darwin


fun TimeZone.toNSTimeZone(): <Error class: unknown class>

Converts this time zone to an NSTimeZone.
toNSTimeZoneOrNull

darwin


fun TimeZone.toNSTimeZoneOrNull(): <Error class: unknown class>?

Converts this time zone to an NSTimeZone, or null if the identifier isn't recognized as valid for an NSTimeZone.
toString

common


open override fun toString(): String

Returns the id of this time zone.
validate

common


fun validate()

Checks if this time zone is valid and throws an exception if it isn't.
validated

common


fun validated(): TimeZone

Ensures that this time zone is valid, throwing an exception if it isn't.