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

jvmMain.krono.LocalDateTimeJvmFactory.kt Maven / Gradle / Ivy

There is a newer version: 3.0.14
Show newest version
@file:Suppress("NOTHING_TO_INLINE")

package krono

import java.time.Instant
import java.time.LocalDateTime
import java.time.ZoneId

inline fun Clock.currentJavaLocalDateTime() = LocalDateTime.ofInstant(Instant.ofEpochMilli(currentMillisAsLong()), ZoneId.of("UTC"))

inline fun LocalDate.toLocalDate() = java.time.LocalDate.of(year, monthNumber, dayOfMonth)

inline fun java.time.LocalDate.toLocalDate() = LocalDate(year, month.value, dayOfMonth)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy