且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将 currentTimeMillis 转换为可读的日期格式?

更新时间:2023-11-29 12:54:28

它会起作用.

long yourmilliseconds = System.currentTimeMillis();
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm");    
Date resultdate = new Date(yourmilliseconds);
System.out.println(sdf.format(resultdate));