Reputation: 42828
I have code like this:
// old_api(Date date)
old_api(calendar.getTime());
Currently, I need to replace Calendar
with Joda-Time DateTime
. I was wondering how I can get java.util.Date
out from Joda-Time DateTime
?
Upvotes: 47
Views: 36314
Reputation: 388
One way to do that is: Extract milli-seconds from joda-datetime instance and then pass it to java.util.Date constructor.
Date date = new java.util.Date(jodaDateTime.getMillis())
Upvotes: 0