在 Java 中,可以使用 java.time
包中的 Instant
类将毫秒转换为时间。例如:
long millis = 1595487320000L;
Instant instant = Instant.ofEpochMilli(millis);
System.out.println(instant); // 输出:2020-07-23T09:52:00Z
在 Java 中,可以使用 java.time
包中的 Instant
类将毫秒转换为时间。例如:
long millis = 1595487320000L;
Instant instant = Instant.ofEpochMilli(millis);
System.out.println(instant); // 输出:2020-07-23T09:52:00Z