Count down from a particular date using flipclock.js

date, flipclock, javascript, time

Solution

This is what I use

<div class="clock"></div>
<script type="text/javascript">
    var date = new Date(2015, 6, 21);
    var now = new Date();
    var diff = (date.getTime()/1000) - (now.getTime()/1000);

    var clock = $('.clock').FlipClock(diff,{
        clockFace: 'DailyCounter',
        countdown: true
    });  
</script>

Months is zero-based, so July, being the seventh month, uses 6.

Problem

I am using http://flipclockjs.com/ This is my call script so far, ``` <script type="text/javascript"> var clock = $('.clock').FlipClock(3600 * 24 * 5, { clockFace: 'DailyCounter', countdown: true, }); </script> ``` Please could someone tell me how i can count down from an exact date? So for example the date is 21st July, 2014 in UK time, and everyone that visits that site will see how long there is remaining till that date based on the current date.

Original source