Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8664423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:14:14+00:00 2026-06-12T17:14:14+00:00

I am using the countdown here http://keith-wood.name/countdown.html and I have added the server time

  • 0

I am using the countdown here http://keith-wood.name/countdown.html and I have added the server time and everything but now with daylight savings my application adds an extra hour to all countdown times at http://www.artfido.com

I have tried changing the server time to not update with daylight savings but my countdown still has an hour added.

UTC time is +10 but don’t know how to change to not have the additional hour.

Code sample

server-time.php  
<?php 
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 
header("Expires: Fri, 1 Jan 2010 00:00:00 GMT"); // Date in the past 
header("Content-Type: text/plain; charset=utf-8"); // MIME type 
$now = new DateTime();
echo $now->format("M j, Y H:i:s O")."\n";
?>

Countdown script
$('#defaultCountdown').countdown({
until: endAuction,
serverSync: serverTime,
timezone: +10,
format: 'DHMS',...

function serverTime() { 
var time = null; 
$.ajax({url: 'server-time.php?random=' + Math.floor(Math.random() * 1000000), 
 async: false, dataType: 'text', 
 success: function(text) { 
 time = new Date(text); 
}, error: function(http, message, exc) { 
time = new Date(); 
}}); 
return time; 
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:14:15+00:00Added an answer on June 12, 2026 at 5:14 pm

    You have used code this way:

    function serverTime() {
        var time = null;
        $.ajax({url: 'cgi/server-time.php?random=' + Math.floor(Math.random() * 1000000),
            async: false, dataType: 'text',
            success: function(text) {
                time = new Date(text);
            }, error: function(http, message, exc) {
                time = new Date();
        }});
        return time;
    }
    

    This function, doesn’t return anything because the AJAX Call is asynchronous. One good way, is to do it in the success function. I meant the initialization of the timer.

    Because, when you call this serverTime() function, it always returns null. It is not instant. Do one thing. Have a function called, startTimer(time) and pass the server’s time in the time variable to the startTimer() and inside the function, define this way:

    function startTimer(time)
    {
        var endAuction = "";
        $(function () {
            endAuction = new Date(
                2012,
                10,
                08,
                12,
                24,
                26                                                                );
            $('#defaultCountdown8077').countdown('destroy')
            $('#defaultCountdown8077').countdown({
                until: endAuction,
                serverSync: time,
                timezone: +10,
                format: 'DHMS',
                expiryUrl: 'http://www.artfido.com'
            });
        });
    }
    

    Also the serverTime(); you are calling somewhere in the middle, and in no way, it would be useful.

    Your JavaScript code would be:

    function initTimer() {
        var time = null;
        $.ajax({url: 'cgi/server-time.php?random=' + Math.floor(Math.random() * 1000000),
            async: false, dataType: 'text',
            success: function(text) {
                time = new Date(text);
                startTimer(time);
            }
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using http://keith-wood.name/countdown.html . Each 'Event' table in my database has a 'date' column.
I'm using this jQuery countdown plugin: http://keith-wood.name/countdown.html I'm trying this to set the countdown
I am using the jquery countdown timer here http://www.littlewebthings.com/projects/countdown/ and I have found that
I have created a Quiz app for Android using the tutorial here: http://automateddeveloper.blogspot.co.uk/2011/06/getting-started-complete-android-app.html For
I am using this jQuery countdown plugin here and it seems pretty straightforward but
I need to give the countdown as shown here , for each item using
I'm using http://tutorialzine.com/2011/12/countdown-jquery/ which animates the numbers down and fades to opacity 0. Edit.
I am using this plugin for a countdown clock Its great, but I need
I'm using a jquery countdown timer and it works everywhere, even in IE7 but
I have countdown which is not taking GMT time. i want it to have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.