Countdown timer for different timezones

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Thu Jul 6 11:18:49 EDT 2006


In <1152196930.404368.249580 at a14g2000cwb.googlegroups.com>, Dirk Hagemann
wrote:

> I'd like to implement a countdown timer on a webite. It should show the
> months, days, hours, minutes and seconds until a given date and time.
> So far it's not really difficult, but this website will be used from
> different time zones, what will make a difference of 10 hours, if I use
> the time-information from the client. The event will take place at one
> fixed moment which is worldwide the same.
> 
> Does anyone know a way to solve this time-zone-problem?

I don't think there's a reliable way to get the time zone information from
the viewer of the website with just HTTP.  So you need a JavaScript
solution I guess.  Send the end time as UTC time to the browser an use
JavaScript's `Date` object to display the countdown in local time.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list