All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.pubnub.api.utils.datetime.kt Maven / Gradle / Ivy

Go to download

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!

There is a newer version: 10.4.6
Show newest version
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