Kerry Kimbrough is not on the time zone mailing list; direct replies appropriately. --ado -----Original Message----- From: Kerry Kimbrough [mailto:kkimbrough@clearcommerce.com] Sent: Friday, June 21, 2002 10:57 AM To: 'tz@elsie.nci.nih.gov' Subject: Time zone equality? Help! Can someone explain the algorithm for TimeZone::operator==? That is, how do you know if two time zones are the same or different? I'm motivated by a UI design issue that's become hot around here. We allow users to select a time zone from a list. In our case, the list come from the ICU package, which I understand uses the same list as the Olsen package. Trouble is, this list is huge and bewildering, with a great deal of apparent redundancy. For example, there are 37 different time zones listed at GMT-04:00. This makes for a usability issue, as it becomes hard to search and confidently select the correct choice. And many are convinced that the long is just wrong because they can see a much shorter one used in Windows. We want to generate a shorter list, but we're also reluctant to just throw out legitimate choices. If two time zones are equivalent, then it's OK to drop one from the list. But how can you tell? How does Windows do it? ---- Regards, Kerry
<<On Fri, 21 Jun 2002 11:20:46 -0400, "Olson, Arthur David (NCI)" <olsona@dc37a.nci.nih.gov> said:
Help! Can someone explain the algorithm for TimeZone::operator==? That is, how do you know if two time zones are the same or different?
If two time zone data files are linked together (or one is listed as a Link for the other in the source files), then they are the same time zone; otherwise not. This is of course using the definitions of the time zone database project. Because the database includes the complete history of civil time (or as close as we can come to it) for at least one location in every country, there are many more time zones (by this definition) than there are regions which currently observe the same civil time. Depending on your need to process retrospective data, you can process the time zone data to exclude transitions before a specific date, and then compare the remaining transitions to achieve a less-strict notion of equality. For example, if your cutoff date is 2002-01-01 (perhaps you're only interested in future dates), then America/New_York is the same as America/Kentucky/Louisville, America/Kentucky/Monticello, America/Detroit, America/Montreal, America/Thunder_Bay, America/Pangnirtung, America/Iqaluit, and America/Nassau. This list includes locations which have changed time regulations as recently as 2001! There are in addition about a dozen places which I have not listed here which observe UTC-05:00 year-round and thus belong to a different zone.
Trouble is, this list is huge and bewildering, with a great deal of apparent redundancy. For example, there are 37 different time zones listed at GMT-04:00.
For any one country, there are not nearly so many choices. If you require your users to select a country first, then you can narrow down the list of time zones substantially.
We want to generate a shorter list, but we're also reluctant to just throw out legitimate choices. If two time zones are equivalent, then it's OK to drop one from the list. But how can you tell? How does Windows do it?
Windows doesn't do it. Windows does not concern itself with timestamps older than Windows itself is. -GAWollman
participants (2)
-
Garrett Wollman -
Olson, Arthur David (NCI)