At 15:48 7-10-03, you wrote:
hello,

is it possible to show the live-clock from the server machine, using php and
javascript, without having to make refresh of that page?
That would be a 99% javascript job.

Find an existing javascript that works.
When the page is loaded let PHP feed the javascript with the current servertime.
In javascript immediately read the time on the usersystem.



Option 1) Compare times and recalculate Calculate the time difference and remember that.

At every time the time has to be displayed again, use the calculate time difference to adjust the time you read on the PC to servertime.

Option 2) trust counters
I'm sure there are time counters in javascript. Start one when the page is loaded and to display time add them up.



For both options you will need functions to add times, this is tricky at the end of the hour and at the end of the day.
(and keep in mind the time difference can be positive as well as negative.
good luck.


Chris
PS maybe the script is already out there somewhere.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to