ekrich / sjavatime   1.1.9

BSD 3-clause "New" or "Revised" License GitHub

Implementation of java.time for Scala.js and Scala Native

Scala versions: 3.x 2.13 2.12 2.11
Scala.js versions: 1.x
Scala Native versions: 0.4


CI Scala.js

sjavatime is a BSD-licensed reimplementation of the java.time API included in JDK8 for Scala.js and Scala Native projects. This project was forked from scala-js-java-time which is deprecated.

Now the library supports both Scala.js and Scala Native.

The library is an incomplete implementation of Java's java.time. Please refer to the Javadoc for API info.

Other choices

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. sconfig uses provided so you are not locked into a java.time provider.

The following projects could be considered as alternatives, the second one for Scala.js only:

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.


Maven Central

Simply add the following line to your sbt settings:

libraryDependencies += "org.ekrich" %%% "sjavatime" % "x.y.z"

To use in sbt, replace 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
    libraryDependencies += "org.ekrich" %%% "sjavatime" % "x.y.z"
    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 launch sbt. sjavatime does not work on earlier JDKs.

Linking errors

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)