Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Approach to convert from org.joda.time.DateTime to java.util.Calendar

Anyone done this and can share? I see an option or two but want to know what others have accomplished.


2 Answers

According to joda-time documentation the preferred method to use is to call this: AbstractDateTime#toCalendar.

like image 167
Esko Avatar answered Sep 15 '25 06:09

Esko


You can also call AbstractInstant#toDate

http://joda-time.sourceforge.net/api-release/org/joda/time/base/AbstractInstant.html#toDate()

like image 28
Michael Krauklis Avatar answered Sep 15 '25 07:09

Michael Krauklis