pytz has so many timezones!

S

Sanjay

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), it is a bit confusing to the users. Is there a smaller and more
practical set? If not, some suggestions on how to handle the
registration form effectively would help me a lot.

thanks
Sanjay
 
D

Diez B. Roggisch

Sanjay said:
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), it is a bit confusing to the users. Is there a smaller and more
practical set? If not, some suggestions on how to handle the
registration form effectively would help me a lot.

I'm not a timezone-guru - but I _think_ if there are 400 timezones defined,
it should list them, shouldn't it? What if you lived in the one that's not
part of the "practical subset"?

The only one who can define what that practical subset is supposed to
consist of is _you_. You know where your app is being used, from whom.

Diez
 
?

=?ISO-8859-1?Q?BJ=F6rn_Lindqvist?=

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), it is a bit confusing to the users. Is there a smaller and more
practical set? If not, some suggestions on how to handle the
registration form effectively would help me a lot.

Windows timezone selector only lists about 80 timezones. But why force
the user to select timezone? Let them select from a list of countries
and then infer the timezone from that data. With multiple alternatives
for countries with more than one timezone, United States EST, United
States PST and so on.
 
G

gatti

I'm not a timezone-guru - but I _think_ if there are 400 timezones defined,
it should list them, shouldn't it? What if you lived in the one that's not
part of the "practical subset"?

I think the problem is displaying a dropdown list of timezones. People
have little idea of how their timezones are called; it would be better
to list countries, which are many but nicely alphabetized, and map the
country to its only timezone, or for the few large countries with more
than a TZ offer a choice later.

Lorenzo Gatti
 
S

Sanjay

Windows timezone selector only lists about 80 timezones. But why force
the user to select timezone? Let them select from a list of countries
and then infer the timezone from that data. With multiple alternatives
for countries with more than one timezone, United States EST, United
States PST and so on.
I think the problem is displaying a dropdown list of timezones. People
have little idea of how their timezones are called; it would be better
to list countries, which are many but nicely alphabetized, and map the
country to its only timezone, or for the few large countries with more
than a TZ offer a choice later.

Thanks for the suggestions!

1. I am unable to understand how Windows manages with only 80 whereas
pytz has 400. Understanding this can be a nice clue for my work. Any
insights?
2. Mapping the timezones to countries is a nice idea. Any idea how to
go about it - I mean whether I have to collect the data manually and
do it, or some better way is available - will help me a lot.

thanks
Sanjay
 
M

mensanator

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.

And there is one country whose clock setting is the product of
a diseased mind (GMT+13), but that isn't a timezone either.

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
it is a bit confusing to the users. Is there a smaller and more
practical set?

Filter the list by location.
 
J

J. Clifford Dyer

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 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. Reducing them to a single time zone will result in aberrant functionality in one or more locales.

Cheers,
Cliff
 
J

J. Clifford Dyer

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 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. Reducing them to a single time zone will result in aberrant functionality in one or more locales.

Cheers,
Cliff
 
C

Carsten Haese

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

But they could have different rules for Daylight Saving Time.
 
A

andrew clarke

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), it is a bit confusing to the users. Is there a smaller and more
practical set? If not, some suggestions on how to handle the
registration form effectively would help me a lot.

Use something like:

for zone in common_timezones:
continent, region = zone.split('/')

Then have two list boxes, one for the continent and the other for the region.

[Australia ]

[Melbourne ]

('Continent' is probably not the right word.)

Regards
Andrew
 
M

mensanator

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.
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.
 
J

J. Clifford Dyer

[ I wrote ]
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.

You don't think that it's an issue that the OPs users will complain about their time being inaccurate? If I register in what we in the US call Eastern Time Zone, I don't want to have to switch to Atlantic time zone just because the form designer couldn't be bothered to include a time zone that actually matched the function of the clocks in my area.

Pedantry about the definition of a time zone is not going to win you points with irate users.

Cliff
 
J

J. Clifford Dyer

Which only matters if you're setting your clock.

Maybe this is where I'm not understanding you: Do you have another use for setting a timezone? The only thing a time zone does, as far as I can tell, is set clocks relative to a shared conception of time.
 
C

Chris Mellon

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.
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.


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.
 
J

J. Cliff Dyer

On 10/8/07, *J. Clifford Dyer* <[email protected]

On Mon, Oct 08, 2007 at 01:13:24PM -0700, (e-mail address removed)
said:
>
> On Oct 8, 1:03 pm, Carsten Haese < (e-mail address removed)
>
> Which only matters if you're setting your clock.
>

Maybe this is where I'm not understanding you: Do you have another
use for setting a timezone? The only thing a time zone does, as far
as I can tell, is set clocks relative to a shared conception of time.


--
http://mail.python.org/mailman/listinfo/python-list




How about a calendar entry: I've got six people in places all over the
world to get on the phone together. If the app doesn't know their
notion of a time zone, that will never happen.

How about financial transactions: time-stamping transactions that move
around the world seems pretty useful to me. How do I know when said
transaction started if I can't convert the user's time into the
server's time?

Timezone is just another localization setting. It is no different
than language or keyboard layout. It is a piece of data that
describes the "world" the user lives in. Unfortunately, DST makes
them very complex because DST is determined by the country and can
change from year to year. I think the US' DST change this year had
more of a real-world impact than Y2K (of course, people actually
planned for Y2K, but that is a different story :).

tj


OK. Those all make sense, but I think they contradict mensanator's
statement that DST and half-hour offsets "only matter[] if you're
setting your clock." None of those are meaningful with 25 generic time
zones, which was what I was trying to understand. Under what normal
circumstances (outside of the US military creating an approximation for
their own internal usage) could 25 tzs be a useful abstraction?

Cheers,
Cliff
 
M

mensanator

On 10/8/07, *J. Clifford Dyer* <[email protected]


Which only matters if you're setting your clock.

Maybe this is where I'm not understanding you: Do you have another
use for setting a timezone? The only thing a time zone does, as far
as I can tell, is set clocks relative to a shared conception of time.

--
http://mail.python.org/mailman/listinfo/python-list




How about a calendar entry: I've got six people in places all over the
world to get on the phone together. If the app doesn't know their
notion of a time zone, that will never happen.
How about financial transactions: time-stamping transactions that move
around the world seems pretty useful to me. How do I know when said
transaction started if I can't convert the user's time into the
server's time?
Timezone is just another localization setting. It is no different
than language or keyboard layout. It is a piece of data that
describes the "world" the user lives in. Unfortunately, DST makes
them very complex because DST is determined by the country and can
change from year to year. I think the US' DST change this year had
more of a real-world impact than Y2K (of course, people actually
planned for Y2K, but that is a different story :).

OK. Those all make sense, but I think they contradict mensanator's
statement that DST and half-hour offsets "only matter[] if you're
setting your clock." None of those are meaningful with 25 generic time
zones, which was what I was trying to understand. Under what normal
circumstances (outside of the US military creating an approximation for
their own internal usage) could 25 tzs be a useful abstraction?

It's how the world goes around.

Some people can't see the forest for the trees.

Is it obvious from all this timezone crap that

- a day lasts 48 hours?

- it can never be the same day everywhere in the world
simultaneously?

Isn't that just as important for worldwide transactions
as Daylight Savings Time (or lack thereof)?

Perhaps, once the basics
 
M

mensanator

[ I wrote ]
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.

You don't think that it's an issue that the OPs users will complain about their time being inaccurate? If I register in what we in the US call Eastern Time Zone, I don't want to have to switch to Atlantic time zone just because the form designer couldn't be bothered to include a time zone that actually matched the function of the clocks in my area.

That wasn't my point. If you know you're in GMT-5 and your computer
knows you're in GMT-5, why do you have to peruse a list of 400
choices,
most of which don't match your GMT offset?
Pedantry about the definition of a time zone is not going to win you points with irate users.

Fine. Then make the user scroll through 400 choices. See how many
points that gets you.
 
M

mensanator

What do you mean by "the military" and why do you think they're
authoritative on the topic of timezones?

Because they publish maps?
The US timekeeping authority
is a branch of the US Navy,

Isn't that "the military"?
but as far as I know they don't define timezones.

Ok, maybe they don't define them. But they get them from somewhere
and the zones are labeled A-Z (don't ask which letter isn't used).
Zone Z is equivalent to GMT and the time is refered to as Zulu time.

That's 25 zones, not 400. Under that system there are no half-hour
offset zones, no zones based on sunset and no lunatic GMT+13 zones.

You'll never learn to run without first learning how to walk.
It's not clear at all from the OPs post exactly what functionality he
is trying to derive from the timezone.

Yep, we can't read his mind.
Since timezones (obviously)
contain more information than just the GMT offset

Of course. But the GMT offset could be used to filter his list
of 400 choices, couldn't it?
(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.

Agreed. But if someone gave me a list of 400 choices, I would look
for some way to reduce the list to a manageable choice. Isn't that
what the OP wants?

Why not teach him the truth, starting from the top level? Shouldn't
you teach him to fish rather than just give him one?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,208
Latest member
RandallLay

Latest Threads

Top