Hard to believe but I think this is the simplest you can manage:
long millisSinceEpoch = timestamp.getTime(); Instant instant = Instant.ofEpochMilli(millisSinceEpoch) OffsetDateTime dt = OffsetDateTime.ofInstant(instant, ZoneId.of("UTC"))
Yikes.
Adventures in Computer Programming – bakert@gmail.com
Hard to believe but I think this is the simplest you can manage:
long millisSinceEpoch = timestamp.getTime(); Instant instant = Instant.ofEpochMilli(millisSinceEpoch) OffsetDateTime dt = OffsetDateTime.ofInstant(instant, ZoneId.of("UTC"))
Yikes.
OffsetDateTime dt = OffsetDateTime.ofInstant(timestamp.toInstant(), ZoneId.of(“UTC”))