Timestamp

open class Timestamp

Event timestamp

The event timestamp is defined as floating-point number of seconds from the CFAbsoluteTime epoch (midnight, January 1, 2001 GMT) and uses variable precision, depending on what the platform can offer. On Android, this is either microseconds or nanoseconds.

This precision is however usually finer than the millisecond precision used by java.util.Date so converting the event timestamp to java.util.Date and back may create rounding errors.

Constructors

Link copied to clipboard
constructor(value: Double)
Constructor.

Properties

Link copied to clipboard
open var value: Double
The timestamp value.

Functions

Link copied to clipboard
Convert java.util.Date to event timestamp.
Link copied to clipboard
open fun fromMicroseconds(@IntRange(from = 0) microseconds: Long): Timestamp
Convert microseconds to event timestamp.
Link copied to clipboard
open fun fromMilliseconds(@IntRange(from = 0) milliseconds: Long): Timestamp
Convert milliseconds to event timestamp.
Link copied to clipboard
open fun toDate(): Date
Convert to java.util.Date, java.util.Date uses millisecond precision so the returned value is rounded to the nearest millisecond.
Link copied to clipboard
Link copied to clipboard
@IntRange(from = 0)
open fun toMicroseconds(): Long
Convert to microseconds,
Link copied to clipboard
@IntRange(from = 0)
open fun toMilliseconds(): Long
Convert to milliseconds, Java time uses millisecond precision so the returned value is rounded to the nearest millisecond.