Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comparing ThreeTen backport to JSR-310

For some reasons, we can't use java 8 right now - we're still stuck at java 7.
However, I'd like to use the new JSR-310 date/time APIs right now, using the official backport ThreeTen.

Its homepage states:

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.

Questions:

  1. What are your experience with ThreeTen? Are there some drawbacks?

  2. How compatible is this project compared to the official JSR-310 implementations?

  3. How much effort is required to migrate from ThreeTen to an official java 8 implementation?

  4. Is it worth to migrate now to ThreeTen and later to JSR-310 - or should someone wait until java 8 can be used, hencing skipping ThreeTen?

like image 532
MRalwasser Avatar asked Mar 30 '15 12:03

MRalwasser


1 Answers

See this blog post.

ThreeTen-Backport is a solid backport consisting of equivalent code for the main API (though not so good for non-ISO calendar systems). To convert to Java 8 java.time requires changing the package name, and altering some constants to be method references.

I would not advise migrating from Joda-Time to ThreeTen-Backport, but do advise migrating from Joda-Time to Java 8 java.time.

like image 145
JodaStephen Avatar answered Nov 12 '22 02:11

JodaStephen