我有这个脚本,它计算从现在到 5 月 8 日 23:59:59 - 5 月 9 日之前 1 秒的天数、小时数和分钟数,并将其显示为带有 FlipClock 的计数器,但由于某种原因它丢失了2天1小时。从今天 3 月 23 日 10:37(24 小时制)开始,有 48 天 13 小时 23 分钟,但我的时钟显示 46 天 12 小时 23 分钟。
应该很简单,但我无法弄清楚 2 天 1 小时在哪里消失了。
我有这个 javascript:
// Grab the current date
var currentDate = new Date();
// Set the date to May 8
var futureDate = new Date(2016, 04, 08, 23, 59, 59);
// Calculate the difference in seconds between the future and current date
var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000;
var clock = new FlipClock($('.clock'), diff, {
clockFace: 'DailyCounter',
countdown: true,
showSeconds: false,
language: 'da'
});