public static void main(String[] args) { String time = System.currentTimeMillis();//获取当前时间精确到毫秒级的时间戳,例:1525849325942 System.out.println(timeStamp2Date(time)) } public static String timeStamp2Date(String time) { Long timeLong = Long.parseLong(time); S
//js时间戳转换日期function formatDate(now) { var year=now.getFullYear(); var month=now.getMonth()+1; var date=now.getDate(); var hour=now.getHours(); var minute=now.getMinutes(); var second=now.getSeconds(); return year+"-"+month+"-"+date+&qu
<!doctype html> <html> <head> <title>Unix时间戳转换成日期格式</title> <script> var a = FormatDateTime("/Date(1497232433000)/") var b = FormatDateTime("1497232740000") console.log(a); //2017-06-12 09:53:53 cons