Để xem ngày/giờ tại epoch (timestamp = 0), tạo new Date(0). Để so sánh với hiện tại, dùng new Date().
Ví dụ
<html>
<head>
<title>Ngày giờ từ Epoch trong JavaScript</title>
</head>
<body>
<script>
var current_date = new Date();
document.write("Ngày hiện tại: " + current_date + "<br>");
var epochDate = new Date(0);
document.write("Ngày tại epoch: " + epochDate);
</script>
</body>
</html>
Kết quả
Ngày hiện tại: Thứ 2, 28 Thg 5 2018 09:23:11 GMT+0530 Ngày tại epoch: Thứ 4, 1 Thg 1 1970 05:30:00 GMT+0530