UtcOffset

expect class UtcOffset

An offset from UTC.

Examples of these values:

  • Z, an offset of zero;

  • +05, plus five hours;

  • -02, minus two hours;

  • +03:30, plus three hours and thirty minutes;

  • +01:23:45, plus one hour, 23 minutes, and 45 seconds.

actual class UtcOffset
actual class UtcOffset
actual class UtcOffset

Constructors

Link copied to clipboard
fun UtcOffset(zoneOffset: ZoneOffset)
Link copied to clipboard
fun UtcOffset(zoneOffset: ZoneOffset)

Types

Link copied to clipboard
expect object Companion
actual object Companion
actual object Companion
actual object Companion

Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
open override fun hashCode(): Int
open override fun hashCode(): Int
toString
Link copied to clipboard
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String

Properties

Link copied to clipboard
expect val totalSeconds: Int

The number of seconds from UTC.

actual val totalSeconds: Int
actual val totalSeconds: Int
actual val totalSeconds: Int

Extensions

Link copied to clipboard
fun UtcOffset.asTimeZone(): FixedOffsetTimeZone

Returns the fixed-offset time zone with the given UTC offset.

Link copied to clipboard
fun UtcOffset.toJavaZoneOffset(): ZoneOffset

Converts this kotlinx.datetime.UtcOffset value to a java.time.ZoneOffset value.