php - Jquery Countdown Server sync issue -
i'm trying create countdown event. i'm using jquery countdown
i have code:
$(function () { var fecha = new date("july 30, 2011 00:00:00"); $('#defaultcountdown').countdown({ until: fecha, format: 'dhms', expiryurl: "http://www.google.com", serversync: servertime, timezone: -4 }); }); function servertime() { var time = null; $.ajax({ url: 'servertime.php', async: false, datatype: 'text', success: function (text) { time = new date(text); }, error: function (http, message, exc) { time = new date(); } }); return time; }
the script working fine, when try change clock date, countdown changes. idea why?
i imagine created servertime.php file on server? http://keith-wood.name/countdown.html tab timezones has php code you'll need add servertime.php script use that. may want qualify url: 'http:yourdomain.com/servertime.php' using should use server time not local pc time. if server on local pc, well... change.
Comments
Post a Comment