java joda time api,Joda Time是否已被Java 8 Date and Time API弃用? (java.time)

Is there any reason to use Joda Time if I can use Java 8 Date and Time API (java.time)?

Should I use Java 8 Date and Time every time?

解决方案

The official statement of the author of Joda-time himself is to migrate as soon as Java-8 is available. See also this citation from the website:

Note that Joda-Time is considered to be a largely “finished” project.

No major enhancements are planned. If using Java SE 8, please migrate

to java.time (JSR-310).

So the short answer to your question is: YES (deprecated). However, keep in mind that some features like Joda-Interval or PeriodType or PeriodFormatter are not available in Java-8 so you have to write your own partially ugly workarounds, see also my SO-post about differences between Joda-Time and JSR-310.

Side remarks about the future of both libraries:

What does "finished" means in this context?

Well, you can compare the Joda-issue 254 with my small discussion on Twitter. I think people should rather set down their expectations to any major enhancement of Joda-Time. Please also consider that the future development resources regarding Joda-Time are limited (lack of manpower). And let's be honest: Most releases since Joda-Time in year 2008 rather have the character of bugfix releases (with the exception of 2.0).

On the other side: The innovation speed of JSR-310 will probably not be very high, too (because it is already big, and because Oracle is here the decisive player and a date-time-library is in general not considered as the central cornerstone of any Java-release). So there is always some space left for an external library in the future to supply missing features, for example (in alphabetical order):

Threeten-Extra (as the favourite of Basil Bourque, see his comment)

Time4J (my own extension, interoperability issue solved in summer 2015)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值