vatsan
vatsan

Reputation:

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.

Upvotes: 23

Views: 30561

Answers (3)

Carlos D. Garza
Carlos D. Garza

Reputation: 41

in the 2.1 you can use

public static Calendar parseCalendar(DateTime dt){
    return dt.toGregorianCalendar();
}

Upvotes: 1

Esko
Esko

Reputation: 29367

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

Upvotes: 26

Related Questions