fluid-time

Kotlin multiplatform date & time library

License

License

GroupId

GroupId

io.fluidsonic.time
ArtifactId

ArtifactId

fluid-time-jvmjdk7
Last Version

Last Version

0.10.2
Release Date

Release Date

Type

Type

module
Description

Description

fluid-time
Kotlin multiplatform date & time library
Project URL

Project URL

https://github.com/fluidsonic/fluid-time
Source Code Management

Source Code Management

https://github.com/fluidsonic/fluid-time

Download fluid-time-jvmjdk7

Dependencies

compile (2)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.0-rc
org.jetbrains.kotlin : kotlin-stdlib-common jar 1.4.0-rc

runtime (3)

Group / Artifact Type Version
org.threeten : threetenbp jar 1.4.4
io.fluidsonic.locale : fluid-locale-jvmjdk7 jar 0.9.0
org.jetbrains.kotlinx : kotlinx-serialization-runtime-jvm jar 1.0-M1-1.4.0-rc

Project Modules

There are no modules declared in this project.

fluid-time

Maven Central JCenter Tests Kotlin kotlinx-datetime #fluid-libraries Slack Channel

Additions for Kotlin's date & time library kotlinx-datetime.

kotlinx-datetime is very early stage and not as actively developed as other official libraries. This library keeps adding missing pieces until the official library catches up.

Installation

build.gradle.kts:

dependencies {
	implementation("io.fluidsonic.time:fluid-time:0.12.0")
}

Additions

  • LocalTime - similar to the existing LocalDate and LocalDateTime
  • LocalTime.midnight - 00:00
  • LocalTime.atDate(LocalDate): LocalDateTime - create LocalDateTime from LocalDate and LocalTime
  • LocalDate.atTime(LocalTime): LocalDateTime - create LocalDateTime from LocalDate and LocalTime
  • LocalDateTime.time - returns its time components as LocalTime
  • Timestamp - alias of Instant for those who prefer that name (Discussion)
  • (LocalDate|LocalDateTime|LocalTime|Timestamp).parseOrNull(String) - like parse() but returns null instead of throwing
  • TimeZone.ofOrNull(String) - like of() but returns null instead of throwing
  • (LocalDate|LocalDateTime|LocalTime|TimeStamp|TimeZone)Serializer - for use with kotlinx-serialization
  • Timestamp.toLocalDate(TimeZone) - shortcut for .toLocalDateTime(timeZone).date
  • Timestamp.toLocalTime(TimeZone) - shortcut for .toLocalDateTime(timeZone).time
  • Timestamp.toJavaDate(): Date - converts a Timestamp to java.util.Date (JVM only)
  • ManualClock - a Clock implementation suitable for unit testing
  • JVM, JS and Darwin are supported. linuxX64 and mingwX64 are not supported.

Previous library

Before kotlinx-datetime was released this library has provided its own date & time implementations for JVM and Darwin. That work has been discontinued in favor of using the new official library, even if experimental, with additions provided by this reworked library. Bugfix releases will still be provided if needed.

You can still use the last previous library version 0.10.5.

License

Apache 2.0

Versions

Version
0.10.2
0.10.1
0.10.0