The title is as it is, but how to convert it to OffsetDateTime when there are LocalDateTime and Clock objects at hand.
I feel like I can do it in one shot, but it seemed like I couldn't do anything about it, so I went through ZonedDateTime.
ZonedDateTime zonedDateTime = LocalDateTime.now().atZone(clock.getZone());
OffsetDateTime offsetDateTime = zonedDateTime.toOffsetDateTime();
Recommended Posts