Timestamp

actual class Timestamp(seconds: Long, nanoseconds: Int) : Comparable<Timestamp> (source)

A point in time with nanosecond precision, mirroring com.google.firebase.Timestamp from the Firebase Android SDK.

The Date and Instant constructors, toDate and toInstant use JVM-only types and can only be called from Android/JVM code: from common code they fail to compile with a message naming the kotlin.time.Instant counterparts, the top-level Timestamp(Instant) function and toKotlinInstant. The Parcelable members are not mirrored.

Parameters

seconds

seconds since the Unix epoch, between -62135596800 and 253402300799 inclusive

nanoseconds

fraction of a second in nanoseconds, between 0 and 999999999 inclusive

expect class Timestamp(seconds: Long, nanoseconds: Int) : Comparable<Timestamp> (source)

A point in time with nanosecond precision, mirroring com.google.firebase.Timestamp from the Firebase Android SDK.

The Date and Instant constructors, toDate and toInstant use JVM-only types and can only be called from Android/JVM code: from common code they fail to compile with a message naming the kotlin.time.Instant counterparts, the top-level Timestamp(Instant) function and toKotlinInstant. The Parcelable members are not mirrored.

Parameters

seconds

seconds since the Unix epoch, between -62135596800 and 253402300799 inclusive

nanoseconds

fraction of a second in nanoseconds, between 0 and 999999999 inclusive

actual class Timestamp(val seconds: Long, val nanoseconds: Int) : Comparable<Timestamp> (source)

A point in time with nanosecond precision, mirroring com.google.firebase.Timestamp from the Firebase Android SDK.

The Date and Instant constructors, toDate and toInstant use JVM-only types and can only be called from Android/JVM code: from common code they fail to compile with a message naming the kotlin.time.Instant counterparts, the top-level Timestamp(Instant) function and toKotlinInstant. The Parcelable members are not mirrored.

Parameters

seconds

seconds since the Unix epoch, between -62135596800 and 253402300799 inclusive

nanoseconds

fraction of a second in nanoseconds, between 0 and 999999999 inclusive

Constructors

Link copied to clipboard
actual constructor(seconds: Long, nanoseconds: Int)
actual constructor(time: Any)

Android/JVM only: the Timestamp(Date) and Timestamp(Instant) constructors; use Timestamp(kotlin.time.Instant) from common code.

expect constructor(seconds: Long, nanoseconds: Int)
expect constructor(time: Any)

Android/JVM only: the Timestamp(Date) and Timestamp(Instant) constructors; use Timestamp(kotlin.time.Instant) from common code.

actual constructor(seconds: Long, nanoseconds: Int)
actual constructor(time: Any)

Android/JVM only: the Timestamp(Date) and Timestamp(Instant) constructors; use Timestamp(kotlin.time.Instant) from common code.

Types

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

Properties

Link copied to clipboard
actual val nanoseconds: Int

Fraction of a second in nanoseconds.

expect val nanoseconds: Int

Fraction of a second in nanoseconds.

actual val nanoseconds: Int

Fraction of a second in nanoseconds.

Link copied to clipboard
actual val seconds: Long

Seconds since the Unix epoch.

expect val seconds: Long

Seconds since the Unix epoch.

actual val seconds: Long

Seconds since the Unix epoch.

Functions

Link copied to clipboard
actual open operator override fun compareTo(other: Timestamp): Int
expect open operator override fun compareTo(other: Timestamp): Int
actual open operator override fun compareTo(other: Timestamp): Int
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
actual fun toDate(): Any

Android/JVM only: this timestamp as a java.util.Date; use toKotlinInstant from common code.

expect fun toDate(): Any

Android/JVM only: this timestamp as a java.util.Date; use toKotlinInstant from common code.

actual fun toDate(): Any

Android/JVM only: this timestamp as a java.util.Date; use toKotlinInstant from common code.

Link copied to clipboard
actual fun toInstant(): Any

Android/JVM only: this timestamp as a java.time.Instant; use toKotlinInstant from common code.

expect fun toInstant(): Any

Android/JVM only: this timestamp as a java.time.Instant; use toKotlinInstant from common code.

actual fun toInstant(): Any

Android/JVM only: this timestamp as a java.time.Instant; use toKotlinInstant from common code.

Link copied to clipboard

This timestamp as a kotlin.time.Instant, the multiplatform form of the JVM-only toInstant() and toDate().

Link copied to clipboard
open override fun toString(): String