WordPress.org

Ready to get started?Download WordPress

Forums

Uji Countdown
[resolved] Uji Countdown - Setting it to a time zone (15 posts)

  1. chevymanusa
    Member
    Posted 2 years ago #

    Is there a way to configure the countdown to work off a preset timezone instead of locally? I had it setup thinking it was working off server time, only to find out it was pulling time from the pc that was browsing the page.

    http://wordpress.org/extend/plugins/uji-countdown/

  2. ujimoto
    Member
    Plugin Author

    Posted 2 years ago #

    In that case your countdown is different on every timezone. For example in Europe your count expire in one hour and other places expire in more hours or is already expired.

  3. chevymanusa
    Member
    Posted 2 years ago #

    I think you misunderstood. I am saying that is the problem right now.
    I downloaded and setup the visual preferences. Then put the countdown in a post set for 1230. Well it expired in Italy (GMT/UTC +0200) at 12:30 (local time) it then expired in Texas (GMT/UTC -0500)at 1230 local time, it then expired in Arizona (GMT/UTC -0700) at 1230 local time.

    So, it appears to me due to the problem I was having that the countdown is based off of the local time of the client and the time of the server.

    Please let me know if you need more clarification.

  4. Wil
    Member
    Posted 1 year ago #

    I have found the same problem.

    The countdown is pretty useless if you are developing for audiences that span one or more timezone.

    The fact that the web is a global thing, why would you use local time for the counter?

    Please amend the plugin urgently and set the counter to use the server time.

    It doesn't make any sense otherwise.

    Wil.

  5. apc33
    Member
    Posted 1 year ago #

    I came to this thread because I want to know how the countdown is displayed across time zones around the world.

    If I set the timer to expire at 18:00 EST, and it is currently 12:00 EST, then on my display I see 6 hours remaining on the clock.

    What I want to know is: will someone in California see 9 hours remaining or 6 hours remaining? That is, is the 18:00 deadline set according to the my time zone setting, the setting of the server, or the setting of the end user (where ever he or she may be the in world)?

  6. Wil
    Member
    Posted 1 year ago #

    Hi @apc33

    The plugin seems to use local PC time.

    Users will see the countdown relative to their timezone unfortunately.

    I hope the plugin author fixes the problem.

  7. apc33
    Member
    Posted 1 year ago #

    Hi Will,

    Thanks for your answer. Actually, I just tested the plugin. I'm in Japan and I got on Skype with someone in the States. Their countdown clock was indeed 13 hours behind mine.

    I suppose it depends on what you want out of the plugin. For us, this is perfect, as we want the clock to expire at midnight on a certain day for all people (their own time), regardless of where they are.

  8. chevymanusa
    Member
    Posted 1 year ago #

    Glad to see I was not the only who was having this issue.

  9. ujimoto
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks you for reporting this problem. Now is clear and fixed. Please update to version 1.0.8.

  10. Wil
    Member
    Posted 1 year ago #

    Super - thanks @ujimoto!

  11. apc33
    Member
    Posted 1 year ago #

    A 'fix' for Wil is a 'break' for me. I hope the new version offers a choice of which timing mechanism to employ. That would meet everyone's needs.

  12. ujimoto
    Member
    Plugin Author

    Posted 1 year ago #

    See can't satisfy all. I will add an option in the next update to choose: local/server time. Until then please use version 1.0.7

  13. warpspeed
    Member
    Posted 1 year ago #

    Updated to 1.0.8 but the timer still doesn't agree across time zones. I've tried activating/deactivating, reinserting, creating a new timer, and no luck. Is there something I'm missing?

  14. coeal1
    Member
    Posted 1 year ago #

    As 10.0.8 is currently written, it will still display the local time. This is because when the Date object is created, JavaScript will automatically use the client timezone even though you are initializing it with the server time. The fix for this is to update the time object with the UTC time instead and subsequently set your countdown to when you want it to expire in UTC (e.g. if you want your counter to expire at 5 PM PDT you'd set it for midnight UTC).

    The code updates I made to get this working were in the countdown.js.php file.

    My updated serverTime() function now looks as follows:

    function serverTime() {
        var time = null;
        jQuery.ajax({url: uji_plugin + '/js/serverTime.php',
            async: false, dataType: 'text',
            success: function(text) {
                time = new Date(text);
    var utcTime = new Date(time.getUTCFullYear(), time.getUTCMonth(), time.getUTCDate(),  time.getUTCHours(), time.getUTCMinutes(), time.getUTCSeconds());
    time = utcTime; }
  15. columbusturbina
    Member
    Posted 1 year ago #

    no matter which time I choose it continues to expire in AM only. I tried military time.. both numbers on slider but can't get it to go to PM.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.