'How to convert an Instant to a LocalTime?

I don't really understand TemporalAdjusters or Java's new time library even after reading numerous tutorials.

How can I convert an Instant object to a LocalTime object. I was thinking something along the lines of the following:

LocalTime time = LocalTime.of(
    instantStart.get(ChronoField.HOUR_OF_DAY),
    instantStart.get(ChronoField.MINUTE_OF_HOUR)
);

But it isn't working. How can I do this?



Solution 1:[1]

yourInstant.atZone(yourZoneId).toLocalTime()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eva