UtcOffset

inline class UtcOffset(totalSeconds: IntSeconds) : Comparable<UtcOffset>

The time shift between a local time and UTC.

Parameters

totalSeconds

the total number of seconds to offset by

Throws

if the offset is outside the supported range

Constructors

UtcOffset
Link copied to clipboard
common
fun UtcOffset(totalSeconds: IntSeconds)
the total number of seconds to offset by

Types

Companion
Link copied to clipboard
common
object Companion

Functions

compareTo
Link copied to clipboard
common
open operator override fun compareTo(other: UtcOffset): Int
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
isZero
Link copied to clipboard
common
fun isZero(): Boolean
Checks if this is the UTC offset of +00:00.
toComponents
Link copied to clipboard
common
inline fun <T> toComponents(action: (hours: IntHours, minutes: IntMinutes, seconds: IntSeconds) -> T): T
Breaks a UTC offset down into components.
inline fun <T> toComponents(action: (sign: Int, hours: IntHours, minutes: IntMinutes, seconds: IntSeconds) -> T): T
Breaks a UTC offset down into components.
toString
Link copied to clipboard
common
open override fun toString(): String
Converts this offset to a string in ISO-8601 extended format.

Properties

totalSeconds
Link copied to clipboard
common
val totalSeconds: IntSeconds
The number of seconds relative to UTC.

Extensions

asTimeZone
Link copied to clipboard
common
fun UtcOffset.asTimeZone(): TimeZone
Converts this UtcOffset into a fixed-offset TimeZone.
toJavaZoneOffset
Link copied to clipboard
fun UtcOffset.toJavaZoneOffset(): ZoneOffset
Converts this UTC offset to an equivalent Java ZoneOffset.
toNSTimeZone
Link copied to clipboard
darwin
fun UtcOffset.toNSTimeZone(): <ERROR CLASS>
Converts this offset into an equivalent NSTimeZone with a fixed UTC offset.