特定の日付までの正確な秒数、分数などを取得しようとしています。これはばかげているように聞こえるかもしれませんが、なぜ結果が 2 倍になるのでしょうか? それは正しくないようですね。
setInterval(function() {
var startDate = new Date(),
startDateTime = startDate.getTime(),
endDate = new Date(2012, 5, 14),
endDateTime = endDate.getTime();
var timeLeft = endDateTime - startDateTime;
var seconds = Math.round(timeLeft / 1000),
minutes = Math.round(seconds / 60),
hours = Math.round(minutes / 60),
days = Math.round(hours / 24),
weeks = Math.round(days / 7);
console.log(weeks, days, hours, minutes, seconds);
}, 1000);