In addition to Timestamp
and Duration
natively available from Protobuf, the Spine Time library
provides a set of data types for describing date and time in a business model.
The types provided by this library follow the conventions offered by Java Time.
The library currently supports Java, Kotlin (Protobuf DSL), and JavaScript.
For JavaScript code, please see the time-js
module.
The versions 1.x
and early 2.x
snapshots are built using Java 8.
Starting 2.0.0-SNAPSHOT.76
, all modules are built with Java 11. Therefore, consumer projects
should aim for Java 11+ to use them.
To add a dependency to a Gradle project, please use the following:
dependencies {
implementation("io.spine:spine-time:$spineVersion")
}
In addition to the generated types and basic factory and calculation routines, the library provides converters between its types and Java Time. It is expected that an application code would perform the date/time calculations using Java Time.
Compatibility with kotlinx-datetime
planned for v2.0.