View Full Version : javascript to show time based on a particular time zone

05-11-2007, 08:41 PM
would there be any way for me to use javascript to display the time based on the time of a particular time zone, rather than the time on the user's computer?


05-12-2007, 01:38 AM
There is, but it requires some server-side scripting. You need to pass the server time (which is a known timezone) to the script, then you can compare the user's time against the server time. To know what timezone the user is in. With those two points of data, you can determine the relative time in any timezone.

05-12-2007, 02:17 AM
It can be done with JavaScript.

Digital clock - http://javascript.about.com/library/bldtime1.htm
Analog clock - http://javascript.about.com/library/blclock1.htm