public static void main(String[] args) { long time1 = 1619598540; String result1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(time1*1000); System.out.println("---10位数的时间戳(毫秒)--->Date:" + result1); double time2 = 1619597640000d; String result2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(time2); System.out.println("---13位数的时间戳(毫秒)--->Date:" + result2); } 注意10位*个1000