sjavatime is a BSD-licensed reimplementation of the
included in JDK8 for Scala.js and Scala Native projects. This project was forked from
scala-js-java-time which is deprecated.
The library is an incomplete implementation of Java's
java.time. Please refer to the
Javadoc for API info.
This project is ready today and cross compiled for all current Scala versions on Scala.js and Scala Native. This project was initial started because no alternative existed to support
sconfig uses provided so you are not locked into a
The following projects could be considered as alternatives, the second one for Scala.js only:
- scala-java-time (recommended): More complete but not ported to Scala Native
- scalajs-jsjoda: implementation of
Cross Build Versions
|Scala Version||Scala.js (1.x)||Native (0.4.x)|
Note: Scala 3 support on Scala Native 0.4.3-RC1 or greater.
Simply add the following line to your
libraryDependencies += "org.ekrich" %%% "sjavatime" % "x.y.z"
To use in
x.y.z with the version from Maven Central badge above.
All available versions can be seen at the Maven Repository.
If you have a
crossProject, the setting must be used only in the JS and/or Native part:
lazy val myCross = crossProject ... .jsSettings( libraryDependencies += "org.ekrich" %%% "sjavatime" % "x.y.z" ) .nativeSettings( libraryDependencies += "org.ekrich" %%% "sjavatime" % "x.y.z" )
Requirement: You must use a host JDK 8, 11 or 17 to build your project, i.e., to
sjavatime does not work on earlier JDKs.
This library is not a complete implementation of
java.time so if classes and methods
are missing and you use them you will get linking errors.
Feel free to contribute to extend the set of supported classes and methods!
sjavatime is distributed under the
BSD 3-Clause license.
Follow the contributing guide.
Release 1.1.9 - (2022-01-25)
Release 1.1.8 - (2022-01-11)
Release 1.1.7 - (2022-01-04)
Release 1.1.6 - (2021-12-30)
Release 1.1.5 - (2021-05-13)
Release 1.1.4 - (2021-05-12)
Release 1.1.3 - (2021-04-01)
Release 1.1.2 - (2021-02-23)
Release 1.1.1 - (2021-02-01)
Release 1.1.0 - (2021-01-26)