Typo in Chapter 22
Closed this issue · 1 comments
zhengye1 commented
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.
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"));
eh3rrera commented
You're right. It's fixed. Thanks! 👍