On 14 Feb 2005 14:13:58 -0800, "stevecap (AT) dca (DOT) net" <stevecap (AT) dca (DOT) net>
wrote:
Quote:
I have a customer who wants clocks for several time zones to display on
her site. We found a Java clock that displays the time for three
cities based on the client computer's internal clock and internal time
zone.
It works beautifully if the client computer is a PC. On Macs
(depending which browser you use) the clocks either don't display at
all or they show a time that bears no clear relationship to the
machine's internal time. It's not even off by an even number of hours,
and different Macs running different OS's display different times.
Is there a platform-neutral solution to this?
Thank you in advance for your wise counsel. |
There's no reliable way of doing this based on the client computer.
Quite a few people don't bother setting their clocks accurately.
Probably even more don't bother setting their time zones accurately.
And I have more than once met idiotic software that requires the
computer using it to have particular settings which may bear no
resemblance to reality. If people are under the impression that the site
is serving up reliable information when it isn't, that could be pretty
misleading.
If it was important to do this (which I rather doubt) I'd deliver a base
time from the web server, calculate the difference from the client clock
at the moment the application starts, and then just use the client clock
to track elapsed time from the base time. But you'd probably have to
program it yourself. And watch out for caching issues etc.
--
Stephen Poley
http://www.xs4all.nl/~sbpoley/webmatters/