[threeten-dev] j.u.Date/Calendrical/GregorianCalendar
Stephen Colebourne
scolebourne at joda.org
Thu Dec 6 02:45:44 PST 2012
On 6 December 2012 06:36, Masayoshi Okutsu <masayoshi.okutsu at oracle.com> wrote:
> I agree with Sherman. The new things should be imported into the old ones.
> But not the other way around.
>
> The conversion between java.util.Calendar and 310 is very tricky.
>
> java.util.Calendar to 310:
>
> How about a similar approach to DateTimeFormatter.parse? Something like
> this:
>
> public <T> T to(class<T> type)
This would probably require reflection to implement, so isn't really
ideal. I think toInstant() and toZoneDateTime() cover most cases.
> 310 to java.util.Calendar:
>
> I prefer to introduce a Builder class in Calendar. I was planning to add
> Calendar.Builder support in JDK 8 for some different reasons. Also, TimeZone
> needs something like getTimeZone(ZoneID), and maybe another one from a
> ZoneOffset.
Or from(ZoneId) ?
ZoneOffset is now a subclass of ZoneId, so does not need a separate method.
Stephen
More information about the threeten-dev
mailing list