On Thu, Aug 6, 2009 at 1:10 PM, Karl Young<ka...@kipshouse.org> wrote: > Ted Byers(r.ted.by...@gmail.com)@2009.08.06 10:42:45 -0400: >> On Wed, Aug 5, 2009 at 10:15 PM, Yitzchak >> Scott-Thoennes<sthoe...@efn.org> wrote: >> > On Wed, August 5, 2009 12:52 pm, Ted Byers wrote: >> >> Is there, in the various timezone packages, support somewhere for >> >> finding out what the timezone is for a given city/state? I have, in my >> >> database, extensive data with the usual contact information from users >> >> from around the world. If at all possible, I would like to query the data >> >> managed by one of the timezone packages to determine the local users' >> >> timezones from their mailing address. Is this possible? Using what? >> > >> > For countries with a single timezone, you can look it up by iso3166 two >> > character code in %DateTime::TimeZone::Catalog::ZONES_BY_COUNTRY. >> > >> > For other countries, I don't know of such support. You can read the >> > comments in zone.tab or the longer comments in the region files in >> > the tzdata package at ftp://elsie.nci.nih.gov/pub/. >> > >> Thanks Yitzchak >> >> So the short answer is that there is no solution at present. >> >> Although we get traffic from all over the world, the bulk of it is >> from the US and Canada, each of which has several time zones. When I >> look at the documentation for the timezone catalog, I see for north >> american data for a small number of cities. Unfortunately that >> doesn't help for the vast majority of mailing addresses in north >> america. >> >> I naively hoped that someone would have assembled a database mapping >> state/province codes within countries to their timezones. >> > Thanks Karl,
> Should be easy enough to do: 50 states in US, and all but a few have a > single timezone. Canada has fewer provinces, but I suspect most of > them span timezones. > Actually, IIRC there are about 5 time zones in Canada, and there are ten provinces and three territories. Alas, I am a rather poor, ignorant Canadian as I can't recall which provinces use which time zones. :-( Or maybe I am just getting senile. :-( > These folks: > > http://www.zip-codes.com/zip-code-database.asp > > wil sell you a US zipcode database with timezones for $US40. > I just learned one of my colleagues found one suitable for the US. >> Isn't it odd that, in the Asia data, there are values for Gaza and >> Jerusalem, which are only a short distance apart (in terms of how far >> a crow would have to fly to travel between them, not politically), or >> more odd, Kuala Lumpur and Singapore (which are separated only by a >> narrow channel), and yet I don't see any data for the major Indian >> cities like Mumbai, Calcutta or Delhi. If there are Indian cities >> represented there, I don't know their names. And THAT strikes me as >> odd, given that India, by itself, has about a quarter of the world's >> population and it has some of the world's largest cities. And yet, in >> the american data, there are values for Glace Bay, Goose Bay, Thunder >> Bay, Whitehorse. It seems strange that what are tiny little villages >> are represented while such huge cities are not. >> > > I don't know about the Asian data, but the *Bay and Whitehorse entries > are in Canada, and are likely the biggest population centers in their > respective timezones. Canada is really big, eh? {-; > Canada is now the largest country on the planet (second largest prior to the fracturing of the USSR) in terms of land mass, but it has a population smaller than many of the larger cities in the developing world. And most of Canada's population are within easy commute distance of Toronto, Montreal and Vancouver. It would be a fun exercise to figure out how many of the other provinces would have to be added together to make a population that is of the same order of magnitude as some of the medium sized cities in southern Ontario. ;-) The main geographic reason the US is so large is that there are so many states in it; most of which could be lost in one or more of the great lakes adjacent to Ontario. And you're probably right about *bay and Whitehorse being the largest population centres in their regions. But Thunder Bay is in Ontario, and is quite small relative to the main cities in southern Ontario (e.g. Toronto) And so, since timezones are not likely defined by latitude, it is certain there are many other cities in their timezones that are much larger (even thought those other cities are hundreds if not thousands of miles away). Cheers, Ted > > >> Oh well, that's just another thing in this world that doesn't make sense. >> >> Thanks anyway, >> >> Ted >