import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
public class Main {
public static void main
(String[] args
) { // An example epoch milliseconds
long millis = 1631113620000L;
Instant instant = Instant.ofEpochMilli(millis);
String strDateTime
= instant.
toString(); System.
out.
println(strDateTime
);
// If you need the value strictly in the pattern, yyyy-MM-dd'T'HH:mm:ss.SSSXXX
DateTimeFormatter dtf
= DateTimeFormatter.
ofPattern("uuuu-MM-dd'T'HH:mm:ss.SSSXXX",
Locale.
ENGLISH); OffsetDateTime odt = instant.atOffset(ZoneOffset.UTC);
strDateTime = odt.format(dtf);
System.
out.
println(strDateTime
); }
}
aW1wb3J0IGphdmEudGltZS5JbnN0YW50OwppbXBvcnQgamF2YS50aW1lLk9mZnNldERhdGVUaW1lOwppbXBvcnQgamF2YS50aW1lLlpvbmVPZmZzZXQ7CmltcG9ydCBqYXZhLnRpbWUuZm9ybWF0LkRhdGVUaW1lRm9ybWF0dGVyOwppbXBvcnQgamF2YS51dGlsLkxvY2FsZTsKCnB1YmxpYyBjbGFzcyBNYWluIHsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKCQkvLyBBbiBleGFtcGxlIGVwb2NoIG1pbGxpc2Vjb25kcwoJCWxvbmcgbWlsbGlzID0gMTYzMTExMzYyMDAwMEw7CgkJSW5zdGFudCBpbnN0YW50ID0gSW5zdGFudC5vZkVwb2NoTWlsbGkobWlsbGlzKTsKCQlTdHJpbmcgc3RyRGF0ZVRpbWUgPSBpbnN0YW50LnRvU3RyaW5nKCk7CgkJU3lzdGVtLm91dC5wcmludGxuKHN0ckRhdGVUaW1lKTsKCgkJLy8gSWYgeW91IG5lZWQgdGhlIHZhbHVlIHN0cmljdGx5IGluIHRoZSBwYXR0ZXJuLCB5eXl5LU1NLWRkJ1QnSEg6bW06c3MuU1NTWFhYCgkJRGF0ZVRpbWVGb3JtYXR0ZXIgZHRmID0gRGF0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