views:

334

answers:

3

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>
+1  A: 

What happens when you change your End Time format to 'Thu, 20 May 2010 17:00:00 IST'?

-edit-

It looks like you're not supposed to pass the date value to until as a String. You can pass in a Date to specify the exact date/time, but a string is only supposed to be used as a time offset, which is why you always get the same amount of time remaining when you refresh.

I couldn't get Date to convert the string with the 'IST' time zone, so I ended up using 'GMT+05:30'. I also put the timezone offset in terms of hours instead of minutes.

<script type="text/javascript">
$(function () {
    var endTime = "Tue, 29 Jun 2010 12:00:00 GMT+0530";
    $('#defaultCountdown').countdown({
        until: new Date(endTime), format: 'HMS',
        timezone: +5.5,
        compact: true, description: endTime.toString()});
});
</script>
Ben Koehler
I tried with the format you have provided. My countdown starts from 00:34:40. My endTime is 'Sat, 26 Jun 2010 09:00:00 IST'.
Kalpana
+2  A: 

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.

sparksm
A: 

I have this version but i don't know how to set the countdown been set as GMT +0 i see the time correctly but a friend of mine in Australia has a completly different time. Any hints on how to set a standard time? Thank you.

the page is here: Link

Chris