Click to See Complete Forum and Search --> : How do I make this clock?


GreyFaerie
09-08-2003, 02:47 AM
ok this one really doesnt make any sense to me at all... there is a clock on the top right side of the layout on the webpage http://www.pinkpt.com and it doesnt go continuously, only when you refresh the page. Im inquiring about this clock becuase i need a clock that I can sent two hours before my time here and to where it shows that same time to everyone else who views the page, and im pretty sure this one does it. what boggles me is that when i looked at the html its just font... nothing speical. but i know that the time changes on it

pyro
09-08-2003, 07:26 AM
It's probably done server side. This will give everyone the server time (though you can adjust which time to give them). Something like this, if your server supports PHP:

<?PHP
$offset = -1; //numbers of hours offset
$time = time()+$offset*3600;
$date = date("g:ia, F j, Y",$time);
echo $date;
?>With that script, say your server is in EST, it will display CST and due to the fact that it runs server side, it will only update itself when the page is refreshed, and will be the same for all visitors.