Hello, how can I get units from an instant? Like `...
# kotlinx-datetime
d
Hello, how can I get units from an instant? Like
instant.get(DateTimeUnit.HOUR)
?
d
Hi!
Instant
is a moment in time, it knows nothing about calendars, wall clocks, etc.
LocalDateTime
is a representation of an
Instant
in a specific time zone. So,
instant.toLocalDateTime(timeZone).hour
.
d
Ok, thank you!