Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将 UNIX 纪元时间转换为一天和时间,例如:
例如 1309778593 到星期一 11:23:12
有什么帮助吗?
从中提取日期组件:
new Date(1309778593)
您可以在以下代码的帮助下做到这一点 -
String epochTime = "1309778593"; Date convertedDate = new Date(Long.parseLong(epochTime) * 1000); System.out.println(convertedDate);
这将打印 -
Mon Jul 04 13:23:13 CEST 2011
我认为这会有所帮助!