toString

actual open override fun toString(): String(source)
expect open override fun toString(): String(source)

Equivalent to id.

Samples

import kotlinx.datetime.*
import kotlinx.datetime.format.*
import kotlin.test.*

fun main() { 
   //sampleStart 
   // Comparing time zones for equality is based on their IDs
val zone1 = TimeZone.of("America/New_York")
val zone2 = TimeZone.of("America/New_York")
check(zone1 == zone2) // different instances, but the same ID
val zone3 = TimeZone.of("UTC+01:00")
val zone4 = TimeZone.of("GMT+01:00")
check(zone3 != zone4) // the same time zone rules, but different IDs 
   //sampleEnd
}
actual open override fun toString(): String(source)
actual open override fun toString(): String(source)