
commonMain.com.pubnub.api.utils.datetime.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pubnub-kotlin-api-jvm Show documentation
Show all versions of pubnub-kotlin-api-jvm Show documentation
PubNub is a cross-platform client-to-client (1:1 and 1:many) push service in the cloud, capable of broadcasting real-time messages to millions of web and mobile clients simultaneously, in less than a quarter second!
package com.pubnub.api.utils
import kotlin.time.Duration
expect class Instant : Comparable {
val epochSeconds: Long
val nanosecondsOfSecond: Int
fun toEpochMilliseconds(): Long
operator fun plus(duration: Duration): Instant
operator fun minus(duration: Duration): Instant
operator fun minus(other: Instant): Duration
override operator fun compareTo(other: Instant): Int
companion object {
fun fromEpochMilliseconds(epochMilliseconds: Long): Instant
fun fromEpochSeconds(epochSeconds: Long, nanosecondAdjustment: Int): Instant
}
}
expect interface Clock {
fun now(): Instant
object System : Clock {
override fun now(): Instant
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy