Search code examples
javascriptjquerycountdown

jquery.countdown.js showing wrong date


Following is the code i am using on jquery countdown but it is calculating wrong date.i need to set it to 1st feb 2015 , tried setting the month to 01 (month starts from zero) but in this case counter disappers

<script>
    $('#clock').countdown('2015/02/01').on('update.countdown', function(event) {
        var $this = $(this).html(event.strftime(''
        + '<ul class="co"><li><a href=""><span>%-d</span><br>Days </a></li>'
        + '<li><a href=""><span>%H</span><br> Hours </a></li>'
        + '<li><a href=""><span>%M</span><br> Minutes </a></li>'
        + '<li><a href=""><span>%S</span><br> Seconds</a></li></ul>'));
    });
</script>   

Solution

  • Assuming you are trying to create a countdown until February 1st, 2015 you should use the following code:

    $('#clock').countdown({until: new Date(2015, 12-11, 1)}))