Flipclock 有一个额外的小时

Flipclock has an extra hour

它假设我的时钟应该计数到 00:00 HRS 但它正在 01:00 HRS

有什么想法吗?

这是我的代码

<html>
    <head>
        <link rel="stylesheet" href="../compiled/flipclock.css">

        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

        <script src="../compiled/flipclock.js"></script>
    </head>
    <body>
    <div class="countdown" style="margin:2em;"></div>
    <div class="message"></div>

    <script type="text/javascript">
        var clock;

    var currentDate = new Date();

    var birthDay = new Date(currentDate.getFullYear() + 1, 2, 13);

    var diff = birthDay.getTime() / 1000 - currentDate.getTime() / 1000;


    clock = $('#countdown').FlipClock(diff, {
        countdown: true,
        clockFace: 'DailyCounter',
        language: 'es',
        showSeconds: true
    });
    </script>
    
    </body>
</html>

ps。生日是 2021 年 3 月 13 日

非常感谢!

你可以看到这个例子:

https://github.com/objectivehtml/FlipClock/blob/master/examples/base.html

在上面的代码片段中,您显示了倒计时时间。它以天、小时、分钟和秒为单位计算从当前日期到给定日期的剩余时间。

请参阅以下示例,其中我们显示了明天的剩余日期、时间和小时数。现在是 12:31 下午,距离明天还有 11 小时 28 分钟。

<!DOCTYPE html>
<html>
<head>
  <title>FlipClock Example</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flipclock/0.7.7/flipclock.min.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/flipclock/0.7.7/flipclock.min.js"></script>
</head>
<body>
  <div id="countdown"></div>
  <script type="text/javascript">
    $(document).ready(function(){
    var clock;
    var currentDate = new Date();
    var birthDay = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()+1);
    console.log(currentDate);
    console.log(birthDay);
    var diff = birthDay.getTime() / 1000 - currentDate.getTime() / 1000;
    clock = $('#countdown').FlipClock(diff, {
        countdown: true,
        clockFace: 'DailyCounter',
        language: 'es',
        showSeconds: true
    });
  });
  </script>

</body>
</html>

输出: