Java程序从纪元和毫秒创建Instant
从纪元创建即时
示例
import java.time.Instant;
public class Demo {
public static void main(String[] args) {
Instant instant = Instant.ofEpochSecond(282829279);
System.out.println(instant);
}
}输出结果
1978-12-18T11:41:19Z
从纪元毫秒创建即时
示例
import java.time.Instant;
public class Demo {
public static void main(String[] args) {
Instant instant = Instant.ofEpochMilli(272827282728l);
System.out.println(instant);
}
}输出结果
1978-08-24T17:21:22.728Z
热门推荐
10 八十大寿简短祝福语
11 端午发给客户祝福语简短
12 蛋糕祝老师祝福语简短
13 邻家生小孩祝福语简短
14 国庆求婚祝福语简短精辟
15 空军大学开学祝福语简短
16 白日庆典祝福语简短英语
17 初升高祝福语家长简短
18 婚礼西装祝福语简短男士