pytz has so many timezones!

Chris Mellon arkanes at gmail.com
Mon Oct 8 16:27:01 EDT 2007


On 10/8/07, mensanator at aol.com <mensanator at aol.com> wrote:
> On Oct 8, 1:00 pm, "J. Clifford Dyer" <j... at sdf.lonestar.org> wrote:
> > On Mon, Oct 08, 2007 at 10:41:03AM -0700, mensana... at aol.com wrote regarding Re: pytz has so many timezones!:
> >
> >
> >
> > > On Oct 8, 2:32 am, Sanjay <skpate... at gmail.com> wrote:
> > > > Hi All,
> >
> > > > I am using pytz.common_timezones to populate the timezone combo box of
> > > > some user registration form. But as it has so many timezones (around
> > > > 400),
> >
> > > There are only 25 timezones: -12, -11, ... -1, 0 (GMT), +1, ... +11,
> > > +12.
> >
> > > A handful of countries set their clocks offset by a half hour,
> > > but those aren't timezones.
> >
> > I'm sorry.  By what even vaguely useful definition of "Timezone" is it not a timezone if it's offset by half an hour?
>
> The miltary doesn't recognize them as timezones. They'll make
> a not that the local time observed doesn't match the timezone,
> but they don't call it a seperate timezone.
>

What do you mean by "the military" and why do you think they're
authoritative on the topic of timezones? The US timekeeping authority
is a branch of the US Navy, but as far as I know they don't define
timezones.

> >
> > > The 400 you're seeing are duplications based on locality. Of the 86
> > > shown in Windows, all but 33 are dulplicate references to the same
> > > timezones.
> >
> > > For example, Windows has seperate listings for
> >
> > > Central America
> > > Central Time (US & Canada)
> > > Guadalahara, Mexico City, Monterry - New
> > > Guadalahara, Mexico City, Monterry - Old
> > > Saskatchewan
> >
> > > but they are all GMT-6
> >
> > Those are non-duplicate (and perhaps inaccurate, I'm not sure).  US time switches from standard to Daylight Savings earlier than Mexico, and switches back later, as of this year.
>
> Duplicate timezones doesn't mean duplicate time,
> as you point out. Does the OP want to know the truth
> or does he want to know something he can understand.
>
> > Reducing them to a single time zone will result in aberrant functionality in one or more locales.
>
> I would hardly think that's an issue on the user registration
> form the OP is trying to create.
>

It's not clear at all from the OPs post exactly what functionality he
is trying to derive from the timezone. Since timezones (obviously)
contain more information than just the GMT offset (otherwise we
wouldn't even have them), he may very well want to use the timezone
given by the user to display correct local time to them. In this case,
the actual, correct, political timezone is important, not just the GMT
offset.

> >
> > Cheers,
> > Cliff
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list