SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); Date date = new Date(System.currentTimeMillis()); System.out.println(formatter.format(date)); 也能够: System.out.println(formatter.format(System.currentTimeMillis()));