I have the time in milliseconds and I need to convert it to a ZonedDateTime object.
I have the following code
long m = System.currentTimeMillis(); L
ZonedDateTime and LocalDateTime are different.
ZonedDateTime
LocalDateTime
If you need LocalDateTime, you can do it this way:
long m = ...; Instant instant = Instant.ofEpochMilli(m); LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());