core-ktx / androidx.time / kotlin.Long

Extensions for kotlin.Long

asEpochMillis

fun Long.asEpochMillis(): Instant

Return an Instant for the number of milliseconds after the epoch.

asEpochSeconds

fun Long.asEpochSeconds(): Instant

Return an Instant for the number of seconds after the epoch.

hours

fun Long.hours(): Duration

Return a Duration representing this value in hours.

millis

fun Long.millis(): Duration

Return a Duration representing this value in milliseconds.

minutes

fun Long.minutes(): Duration

Return a Duration representing this value in minutes.

nanos

fun Long.nanos(): Duration

Return a Duration representing this value in nanoseconds.

seconds

fun Long.seconds(): Duration

Return a Duration representing this value in seconds.