Code

How to countdown for a few minutes?

« See all FAQs for CircleTimer - jQuery Countdown Timer

How to countdown for a few minutes?

You can countdown the timer for a few minutes like that:

$(document).ready(function() {

    function formatDate(date) {
        var year = date.getFullYear();
        var month = ('0'+(date.getMonth()+1)).slice(-2);
        var day = ('0'+date.getDate()).slice(-2);
        var hour = ('0'+date.getHours()).slice(-2);
        var minute = ('0'+date.getMinutes()).slice(-2);
        var second = ('0'+date.getSeconds()).slice(-2);                

        return year+"/"+month+"/"+day+" "+hour+":"+minute+":"+second;
    }

    var startDate = new Date();
    var endDate = new Date(startDate);
    var addMinute = 3; //Change minutes
    endDate.setMinutes(endDate.getMinutes()+addMinute);    

    //Countdown timer
    $(".countdown").circleTimer({
        startDate:formatDate(startDate),
        endDate:formatDate(endDate),
        showDay:false,
        showHour:false,
        timeZone:-5, //Time zone of New York (Change time zone)
        onFinish:function() {
            alert("Countdown ended");
        }
    });

});

You should write your time zone to make it work properly.

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey