Forum Moderators: coopster
<?php
$i=1;
while($i=1)
{
echo date("g:i:s A T");
}
?>
Also is there a way to adjust the time zone? It seems to use the time of my host's server which is EST and I'm on PST. Thanks!
Welcome to WebmasterWorld!
Unfortunately, I'm not sure I understand your question.
over and over on the same line.
You want it to keep track of previous times and create a list?
How do I overwrite the existing time rather than repeat?
I don't follow that either I'm sorry to say. In terms of the web page, there's really nothing to "overwrite" because by the time that data gets displayed on a page, it's gone from the script.
How about this - give two examples of how you want the date displayed say, on first view and then after refreshing the page.
Cheers,
Tom
The code above doesn't work at all, obviously. It's inserted into a table cell.
That's probably not what you want though, it will suck your bandwidth, new page every three seconds. A much better way is to use some kind of 'clock' javascript.
Javascript puts code in the user's browser, and the code is run there, independent of your server, and can do all sorts of nifty things (on many webpages, way too many nifty things), including displaying the current time. Try googling javascript clock. You can output the javascript just by escaping out of php (?>Plain Old HTML and Javascript here) or using echo:
echo 'your javascript here';