📜  在 java 代码示例中将 long 转换为 date

📅  最后修改于: 2022-03-11 14:52:35.854000             🧑  作者: Mango

代码示例1
//The Date constructor (click the link!) accepts the time as long in milliseconds, not seconds.
long currentDateTime = System.currentTimeMillis();
//creating Date from millisecond
Date currentDate = new Date(currentDateTime);