📅  最后修改于: 2022-03-11 14:52:35.854000             🧑  作者: Mango
//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);