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.
@Matt, Great example, however I can see why "coolshrimp" posted a similar formula, both are half correct.
In my website, when i use jsfiddle, I want it to also show "Hours" "Minutes" and "Seconds", the following example worked perfectly for me:
<script type="text/javascript">
var date = new Date("February 01, 2016 02:15:00"); //Month Days, Year HH:MM:SS
var now = new Date();
var diff = (date.getTime()/1000) - (now.getTime()/1000);
var clock = $('.clock').FlipClock(diff,{
clockFace: 'DailyCounter',
countdown: true
});
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With