Created
August 24, 2018 11:27
-
-
Save benpdavison/ecc81589116c241e5ba8b19ef6b3e0ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.Instant; | |
import java.time.LocalDateTime; | |
import java.time.ZoneOffset; | |
import java.time.ZonedDateTime; | |
import java.time.format.DateTimeFormatter; | |
class EPOCToISO { | |
public static void main(String[ ] args) { | |
Long epoch = 1535109390070L; | |
Instant i = Instant.ofEpochMilli(epoch); | |
ZonedDateTime z = ZonedDateTime.ofInstant(i, ZoneOffset.UTC); | |
System.out.println(DateTimeFormatter.ISO_INSTANT.format(z)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment