By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,167 Members | 1,692 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,167 IT Pros & Developers. It's quick & easy.

pytz has so many timezones!

P: n/a
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

Oct 8 '07 #1
Share this Question
Share on Google+
27 Replies


P: n/a
Sanjay 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), 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
Oct 8 '07 #2

P: n/a
On 10/8/07, Sanjay <sk*******@gmail.comwrote:
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.

--
mvh Björn
Oct 8 '07 #3

P: n/a
On Oct 8, 10:40 am, "Diez B. Roggisch" <de...@nospam.web.dewrote:
Sanjay 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), 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"?
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

Oct 8 '07 #4

P: n/a
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

Oct 8 '07 #5

P: n/a
On Oct 8, 2:32 am, Sanjay <skpate...@gmail.comwrote:
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.
If not, some suggestions on how to handle the
registration form effectively would help me a lot.

thanks
Sanjay

Oct 8 '07 #6

P: n/a
On Mon, Oct 08, 2007 at 10:41:03AM -0700, me********@aol.com wrote regarding Re: pytz has so many timezones!:
>
On Oct 8, 2:32 am, Sanjay <skpate...@gmail.comwrote:
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 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
Oct 8 '07 #7

P: n/a
On Mon, Oct 08, 2007 at 10:41:03AM -0700, me********@aol.com wrote regarding Re: pytz has so many timezones!:
>
On Oct 8, 2:32 am, Sanjay <skpate...@gmail.comwrote:
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 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
Oct 8 '07 #8

P: n/a
On Mon, 2007-10-08 at 10:41 -0700, me********@aol.com wrote:
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.

--
Carsten Haese
http://informixdb.sourceforge.net
Oct 8 '07 #9

P: n/a
On Mon, Oct 08, 2007 at 12:32:19AM -0700, Sanjay wrote:
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
Oct 8 '07 #10

P: n/a
On Oct 8, 1:00 pm, "J. Clifford Dyer" <j...@sdf.lonestar.orgwrote:
On Mon, Oct 08, 2007 at 10:41:03AM -0700, mensana...@aol.com wrote regarding Re: pytz has so many timezones!:
On Oct 8, 2:32 am, Sanjay <skpate...@gmail.comwrote:
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.
>
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.
>
Cheers,
Cliff

Oct 8 '07 #11

P: n/a
On Oct 8, 1:03 pm, Carsten Haese <cars...@uniqsys.comwrote:
On Mon, 2007-10-08 at 10:41 -0700, mensana...@aol.com wrote:
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.
Which only matters if you're setting your clock.
>
--
Carsten Haesehttp://informixdb.sourceforge.net

Oct 8 '07 #12

P: n/a
On Mon, Oct 08, 2007 at 01:12:32PM -0700, me********@aol.com wrote regarding Re: pytz has so many timezones!:
[ 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
Oct 8 '07 #13

P: n/a
On Mon, Oct 08, 2007 at 01:13:24PM -0700, me********@aol.com wrote regarding Re: pytz has so many timezones!:
>
On Oct 8, 1:03 pm, Carsten Haese <cars...@uniqsys.comwrote:
On Mon, 2007-10-08 at 10:41 -0700, mensana...@aol.com wrote:
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.

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.
Oct 8 '07 #14

P: n/a
On 10/8/07, me********@aol.com <me********@aol.comwrote:
On Oct 8, 1:00 pm, "J. Clifford Dyer" <j...@sdf.lonestar.orgwrote:
On Mon, Oct 08, 2007 at 10:41:03AM -0700, mensana...@aol.com wrote regarding Re: pytz has so many timezones!:
On Oct 8, 2:32 am, Sanjay <skpate...@gmail.comwrote:
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
Oct 8 '07 #15

P: n/a
On 10/8/07, Sanjay <sk*******@gmail.comwrote:
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.
You might find some good information by brushing up on the Olson time
zone database:

http://en.wikipedia.org/wiki/Zoneinfo
http://www.twinsun.com/tz/tz-link.htm
Oct 8 '07 #16

P: n/a
On Oct 8, 3:23 pm, "J. Clifford Dyer" <j...@sdf.lonestar.orgwrote:
On Mon, Oct 08, 2007 at 01:12:32PM -0700, mensana...@aol.com wrote regarding Re: pytz has so many timezones!:
[ 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.
>
Cliff

Oct 9 '07 #17

P: n/a
On Oct 8, 3:27 pm, "Chris Mellon" <arka...@gmail.comwrote:
On 10/8/07, mensana...@aol.com <mensana...@aol.comwrote:


On Oct 8, 1:00 pm, "J. Clifford Dyer" <j...@sdf.lonestar.orgwrote:
On Mon, Oct 08, 2007 at 10:41:03AM -0700, mensana...@aol.com wrote regarding Re: pytz has so many timezones!:
On Oct 8, 2:32 am, Sanjay <skpate...@gmail.comwrote:
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?
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.
>
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.
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?
>
Cheers,
Cliff
--
http://mail.python.org/mailman/listinfo/python-list
Oct 9 '07 #18

P: n/a
On 10/8/07, me********@aol.com <me********@aol.comwrote:
What do you mean by "the military" and why do you think they're
authoritative on the topic of timezones?

Because they publish maps?
I'm not sure what this has to do with it.
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.
They get them from NATO. NGO's outside of NATO do not use NATO time
zones for describing time data, mostly because NATO doesn't care about
daylight savings time. Works fine for the military, but not so well
for your civilian users.
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.
Yes, but lucky for us, we live in the real world, so we have to deal
with 400 time zones. The reality is that people LIVE in those
'lunatic' time zones, and software needs to address that.

If I schedule a meeting with someone in Indiana, and I'm in Ohio,
they're in the same military time zone, but they don't observe
daylight savings time, so in fact our times are different. Users
probably want our applications to handle these problems.
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?
Sortof. First, your user has to understand what GMT is, so that's
already going to cause problems. Secondly, you need to handle time
zones which drift from different GMT offsets depending on the time of
year. At the very least your algorithm needs to be greedy.
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?
Because the truth is that there are upwards of 400 different time
zones, accounting for local custom and law. The military can
conveniently ignore that, but we as application writers cannot.

There is no central authority which defines global time zones. The
functional definition of a time zone is merely a geographical area of
the earth that has adopted the same local time rules.

--
Nick
Oct 9 '07 #19

P: n/a
On Oct 8, 8:27?pm, "Nicholas Bastin" <nick.bas...@gmail.comwrote:
On 10/8/07, mensana...@aol.com <mensana...@aol.comwrote:
What do you mean by "the military" and why do you think they're
authoritative on the topic of timezones?
Because they publish maps?

I'm not sure what this has to do with it.
Maybe you've never had to navigate?
>
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.

They get them from NATO. NGO's outside of NATO do not use NATO time
zones for describing time data, mostly because NATO doesn't care about
daylight savings time. Works fine for the military, but not so well
for your civilian users.
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.

Yes, but lucky for us, we live in the real world, so we have to deal
with 400 time zones. The reality is that people LIVE in those
'lunatic' time zones, and software needs to address that.
WHY must we accomodate the ignorant? Why not cut them off
from the Internet until they get their act together? Don't
people get mad at Microsoft for breaking standards? People like
you are to blame for accomodating broken standards. "Oh, no,
we can't afford to lose those three potential customers who
live on an island in Kiribati!"
>
If I schedule a meeting with someone in Indiana, and I'm in Ohio,
they're in the same military time zone, but they don't observe
daylight savings time, so in fact our times are different. Users
probably want our applications to handle these problems.
Isn't that what they call a "locale"?
>
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?

Sortof. First, your user has to understand what GMT is,
And you start that education by learning the 25 timezones.
Then when you understand that, you can then learn about locales.
so that's
already going to cause problems. Secondly, you need to handle time
zones which drift from different GMT offsets depending on the time of
year.
It helps to know what you're drifting from.
At the very least your algorithm needs to be greedy.
How good an algorithm do you think the OP will come up
with if he doesn't understand why his list has 400 items
or has any clue how to reduce it?
>
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?

Because the truth is that there are upwards of 400 different time
zones,
Locales.
accounting for local custom and law. The military can
conveniently ignore that, but we as application writers cannot.
But you can safely ignore the basis of the 400 locales?
>
There is no central authority which defines global time zones. The
functional definition of a time zone is merely a geographical area of
the earth that has adopted the same local time rules.
So, you can live your life with functional definations,
never bothering to learn any theory? Is code monkey all you
aspire to?
>
--
Nick

Oct 9 '07 #20

P: n/a
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.
I am developing a website which would be accessed by members all over
the world. They can exchange data having some time fields, say
'schedule for next meeting'. Whenever somebody feeds some time field,
my application converts it to UTC and stores in the database. Later,
when the data is to be displayed to some member, the application
converts it to his local time, and displays the data.

thanks
Sanjay

Oct 9 '07 #21

P: n/a
On 10/9/07, Sanjay <sk*******@gmail.comwrote:
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.

I am developing a website which would be accessed by members all over
the world. They can exchange data having some time fields, say
'schedule for next meeting'. Whenever somebody feeds some time field,
my application converts it to UTC and stores in the database. Later,
when the data is to be displayed to some member, the application
converts it to his local time, and displays the data.
Yeah, you are, unfortunately, probably going to have to deal with the
entirety of this time zone data in this case. You can obviously elide
some information for countries you don't intend to support, but
there's no particular reason to exclude a potential market.

I would say the easiest way to get people to choose their own time
zone is to ask them their country, and then filter their choices by
that. (That would get you down to less than a dozen choices in almost
every country in the world).

--
Nick
Oct 9 '07 #22

P: n/a
Nicholas Bastin wrote:
>
There is no central authority which defines global time zones. The
functional definition of a time zone is merely a geographical area of
the earth that has adopted the same local time rules.
In fact, even the authorities who do define time zones don't always
have the final say. In Xinjiang province in Western China, the
official time zone is the same as Beijing, even though Xinjiang is
about as far west of Beijing as Nevada is from DC, so the sun comes up
around "noon" and sets around "midnight." So many people set their
clocks to unofficial Xinjiang time, three hours offset from Beijing.

In offering a "Xinjiang" timezone set to the unofficial time, you
might win some customers who see you as being on their side. Xinjiang
is a muslim country, so you might also score points with muslims
elsewhere in the world who see their minority Uighur brethren as
oppressed by the authorities of Beijing. On the other hand, you might
annoy the authorities in Beijing. Which is just to say that choice of
time zone is not just a geographic issue. There are political,
diplomatic issues to weigh as well.

Cheers,
Cliff
Oct 9 '07 #23

P: n/a
me********@aol.com wrote:
On Oct 8, 1:03 pm, Carsten Haese <cars...@uniqsys.comwrote:
>On Mon, 2007-10-08 at 10:41 -0700, mensana...@aol.com wrote:
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.

Which only matters if you're setting your clock.
That's BS. If I'm supposed to be attending a video-conference that spans a
few continents which is scheduled using a web-app, it's VITAL that I get
the invitation and reminder rendered in MY local timezone, DST included.

And for the matter of

"""
There are only 25 timezones: -12, -11, ... -1, 0 (GMT), +1, ... +11,
+12.
"""

who says that timezones have to be separated by one hour each? Why aren't
they separated by 30minutes, or 20, or 10? Or 2 hours? Or why don't we have
a global time?

Your 25 timezones are an abstraction the same way as are the 400 apparently
in use by people all over the world - and last time I checked, there was no
fundamental law in physics or such that limited the allowed or sensible
number of timezones...

Diez
Oct 9 '07 #24

P: n/a
On Oct 9, 2:58 am, Dennis Lee Bieber <wlfr...@ix.netcom.comwrote:
On Mon, 08 Oct 2007 10:41:03 -0700, "mensana...@aol.com"
<mensana...@aol.comdeclaimed the following in comp.lang.python:
There are only 25 timezones: -12, -11, ... -1, 0 (GMT), +1, ... +11,
+12.

Uhm... -12 and +12 would be the same, wouldn't they?
No, they are seperated by the International Date Line,
so although zones -12 & +12 have the same clock time, they
are different dates.
>
There are only 24 divisions 15deg wide in longitude, 7.5deg to each
size of zone center, and Greenwich is center of 0...
And zones -12 & +12 are each nominally 7.5deg wide,
so 23*15 + 2*7.5 gives you 25 zones spanning 360deg.
>
However, consider that the former Soviet Union is reputed to have
used only ONE timezone for the entire width of the country (sunrise at
6AM say in Moscow would be near sunset on the east coast)
When was this, in the days before air travel when it took
3 weeks to cross Siberia by train?
>
So while there are only 24 hourly offsets, there can be many "zones"
to reflect variations in daylight time changes or non-standard
offsets...
The point I was trying to make is that although there may
be 400 zones, there aren't 400 offsets. And aren't these
offsets part of the timezone record?
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfr...@ix.netcom.com wulfr...@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-a...@bestiaria.com)
HTTP://www.bestiaria.com/

Oct 9 '07 #25

P: n/a
On 10/9/07, me********@aol.com <me********@aol.comwrote:
Why aren't they separated by 30minutes, or 20, or 10? Or 2 hours?

Why isn't an hour defined to be 30 minutes?
Or why don't we have a global time?

Like UTC?

Your 25 timezones are an abstraction the same way

Not the same way at all. The 25 timezones I speak of are
not merely an abstraction, but related to longitude.
See, here's what the problem is. You've invented your own definition
of "timezone", which has no relation to how anyone else uses the word,
and are now arguing loudly and rudely about how your pet definition is
right, and everyone else is wrong.

You should have just said at the beginning that you were just
redefining all the terms to match your preference, so I could have
killfilled you then instead of reading all your posts in hope that you
actually had something important and useful to say.
Oct 9 '07 #26

P: n/a
Thanks a lot, Guys. The immediate step I think to take is having two
combo boxes (dividing the data by '/'). Thanks for enormous response
and the valuable suggestions!

Sanjay

Oct 10 '07 #27

P: n/a
On 10/10/07, Sanjay <sk*******@gmail.comwrote:
Thanks a lot, Guys. The immediate step I think to take is having two
combo boxes (dividing the data by '/'). Thanks for enormous response
and the valuable suggestions!
The most elegant way I've seen to handle this in a graphical interface
(either a web app, or a full GUI), is to present the user with some
sort of map where they can click on their approximate location, and
then select the appropriate timezone from there. I don't think that
the pytz module is set up to support that interface very well though.

--
Jerry
Oct 11 '07 #28

This discussion thread is closed

Replies have been disabled for this discussion.