如何将LocalDateTime转换为GregorianCalendar?
如果无法解析简单的 ,为什么可以将对象传递到方法中,如下所示?LocalDateTime
ZonedDateTime.from()
DateTime
@Test
public void test() throws Exception {
GregorianCalendar.from(ZonedDateTime.from(LocalDateTime.parse("2016-08-31T23:00:59")));
}
结果:
java.time.DateTimeException: Unable to obtain ZonedDateTime from TemporalAccessor: 2016-08-31T23:00:59 of type java.time.LocalDateTime
at java.time.ZonedDateTime.from(ZonedDateTime.java:565)