Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to set GMT+5:30 as my timezone in jquery countdown. Start Time for countdown is 'Thu May 20 16:00:00 IST 2010' End Time is 'Thu May 20 17:00:00 IST 2010' as value.

+330 is my timezone given in minutes. But my countdown starts from 00:35:00. I would have expected the countdown to start from 01:00:00 Not sure why this is discrepancy is there.

    <script type="text/javascript">
        $(function () {
            var endTime = '#{myBean.getCountDownDate()}';
            $('#defaultCountdown').countdown({
                until: endTime, format: 'HMS',
                timezone: +330,
                compact: true, description: '#{myBean.getCountDownDate()}'});
        });
    </script>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
191 views
Welcome To Ask or Share your Answers For Others

1 Answer

When using the until parameter the countdown plugin counts down until that time.

This will run for one hour using the correct offset.

$('#countdown').countdown({
    until: $.countdown.UTCDate(+330, 2010, 6-1, 20, 17),
    format: 'HMS',
    compact: true
});

Since 2010:06:20:17 has already passed it will display 00:00:00.

I would bet the reason you got 00:35:00 in your countdown is that you were looking at it around 2010:06:20:16:25.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...