I also see that you are using a method of gathering time data that is really out of the ark.
Write in the current server time with PHP
$rfc = date("r");
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>The Server Time</title>
timeSrv = new Date( "<?php echo $rfc;?>" ).getTime();
stringTime = new Date(timeSrv ).toUTCString().slice(17,25); // returns 00:00:00 format time
You will need to sub the local timezone of your server here date_default_timezone_set('America/Los_Angeles');
What you then have is a date object returned by the server, set on the clients machine as milliseconds
the stringTime will be a string time representation already formatted
You will need to have other time functions if you want to have the time of this object advanced, because this is in milliseconds, you can incorporate other functions that return milliseconds so you can calculate what you need.
Avoid using setTimeout callbacks, they take time to set up and consume time, use the setInterval, it only needs to be set once and it will keep on calling the function until page is shut down or navigated away from.