ThreeTen-Backport provides a backport of the Java SE 8 date-time classes to Java SE 6 and 7.
The backport is NOT an implementation of JSR-310, as that would require jumping through lots of unnecessary hoops. Instead, this is a simple backport intended to allow users to quickly use the JSR-310 API on Java SE 6 and 7. The backport should be referred to using the "ThreeTen" name. The backport is curated by the primary author of the Java 8 date and time library, Stephen Colebourne.
ThreeTen-Backport is licensed under the business-friendly BSD 3-clause license.
The features of the backport match those of Java SE 8:
- Date and time value types
- Formatting
- Alternate calendar systems
- Utilities
The API of ThreeTen-Extra matches that of Java SE 8 as far as practicable.
Default and static methods on interfaces are simulated in the backport
by using an abstract class rather than an interface.
In addition, static query constants are used to simulate method references, for example
use LocalDate.FROM
rather than LocalDate::from
.
Various documentation is available:
- The Javadoc
- The change notes for each release
- The GitHub source repository
- The mechanism to update the time-zone information
Release 1.3.4 is the latest release. It is considered to be stable and usable in production.
The project runs on Java SE 6 (or later) and has no dependencies.
There are some known issues. The Hijrah calendar system does not work. Formatting and parsing often depends on data only available in Java SE 8. Zone id and text parsing is significantly less powerful.
Available in Maven Central.
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
<version>1.3.4</version>
</dependency>
Support on bugs, library usage or enhancement requests is available on a best efforts basis.
To suggest enhancements or contribute, please fork the source code on GitHub and send a Pull Request.
Alternatively, use GitHub issues.
Note that pull requests and issues will only be considered so far as matching the behaviour of Java SE 8. Additional requested features will be rejected.