Hi folks. Any ideas as to why `Clock.System.now()....
# kotlinx-datetime
a
Hi folks. Any ideas as to why
Clock.System.now().toEpochMilliseconds()
returns time in UTC rather than local time? What was the rationale behind this behaviour?
h
Clock.now returns an Instant that is always in UTC. If you need a local time, you have to specify a time zone du to day light saving time and changing time zones.
c
Instant is a representation of time in UTC. In order to have the time in a representation of a specific timezone
Instant.toLocalDateTime
can be used.
LocalDataTime
can be converted to
Instant
by using
LocalDateTime.toInstant(TimeZone)