Closed zhengye1 closed 5 years ago
The following example below is wrong
OffsetDateTime odt = OffsetDateTime.of( LocalDateTime.now(), ZoneOffset.of(+03:00)); OffsetTime ot = OffsetTime.of( LocalTime.now(), ZoneOffset.of(-08:00));
The reason is java cannot compile it, and also ZoneOffset.of() only accept String as parameter.
ZoneOffset.of()
The fix should be like this
OffsetDateTime odt = OffsetDateTime.of( LocalDateTime.now(), ZoneOffset.of("+03:00")); OffsetTime ot = OffsetTime.of( LocalTime.now(), ZoneOffset.of("-08:00"));
You're right. It's fixed. Thanks! 👍
The following example below is wrong
The reason is java cannot compile it, and also
ZoneOffset.of()
only accept String as parameter.The fix should be like this