Hi,

I'm looking for some help with a javascript/php code that will display a countdown from midnight server time to midnight servertime the next day. and reset its self everyday.

So far i've got this:
Code:
function ShowTimes() {
  var now = new Date();
  var hrs = 23-now.getHours();
  if (hrs < 10) hrs = '0'+hrs;
  var mins = 59-now.getMinutes();
  if (mins < 10) mins = '0'+mins;
  var secs = 59-now.getSeconds();
  if (secs < 10) secs = '0'+secs;
  document.getElementById('countdownToMidnight').innerHTML = hrs+':'+mins+':'+secs+'';
}
var _cntDown;
function StopTimes() {
	clearInterval(_cntDown);
}
But obviously this does it via the users computer time so is different depending where you are.

I need it so wherever you are in the world the countdown is at the same time as everyday at midnight (servertime) an image on the website changes.


Sorry if I've done something wrong here, it's my first post.
Any help would be very much appreciated and if you require any more info just let me know

Thanks
- Jamie