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

commonMain.LocalDateTime.kt Maven / Gradle / Ivy

There is a newer version: 0.18.0
Show newest version
package io.fluidsonic.time

import kotlinx.datetime.*


public val LocalDateTime.time: LocalTime
	get() = LocalTime(hour = hour, minute = minute, second = second, nanosecond = nanosecond)


// https://kotlinlang.slack.com/archives/C01923PC6A0/p1597788327006500
public fun LocalDateTime.toTimestamp(timeZone: TimeZone): Timestamp =
	toInstant(timeZone)


public fun LocalDateTime.Companion.parseOrNull(isoString: String): LocalDateTime? =
	runCatching { parse(isoString) }.getOrNull()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy