Time zone

CanadianSandford Fleming invented Standard Time in 1879. He proposed that the world should be divided into 24 equal Time Zones, and that the time within each zone would be the same. Up until then, it had varied from community to community. The railways were the first to adopt the idea and by 1890 all countries had adopted the Standard Time system. Prior to that the U.S. had about 300 local times. Sanford Fleming was knighted in 1897 for his idea.

Each Time Zone contains 15 degrees of longitude. The first time zone is located at Greenwich in England.

Time zones are a far worse mess than immediately meets the eye. Fifteen degrees of longitude would be nice, but as the fearsome Lord Brawl observes, the zones themselves are gerrymandered everywhere in order to conform to national and provincial borders, sea coasts, etc. But that's no big deal.

Where it turns into a genuinely weird mare's nest, is when you throw Daylight Saving Time into the mix. The US state of Indiana is at UTC-5:00, USEastern Standard Time (EST) -- but Indiana doesn't observe Daylight Saving Time1. Half the year, they're on the East coast; the other half, they're in the Midwest. If you're writing software to handle time, the best way to deal with mutants like Indiana is to define a time zone as the aggregate of the values of all the properties a given area has: UTC offset, DST offset (most of them are an hour, but some are half an hour or whatever), DST start date and start time (not all start at 2:00 AM local time), and DST end date and end time. Since winter and summer in the northern hemisphere are the reverse of those in the southern hemisphere, DST down there starts around the time it ends up here, and vice versa: Quito (Equador) and Baltimore (USA) are at about the same longitude, but their DST adjustments are totally incompatible (for one thing, as Linca rightly observes, Ecuador is on the equator (hence the name) so there's very little sense in observing daylight savings time there anyway -- and they don't. So I'll have to dig up someplace else on Baltimore's longitude but far enough south to do DST).

Thanks to DST, A "time zone" cannot be defined as "all locations which share the same base offset from UTC". Rather, a "time zone" is best defined as "the set of all locations guaranteed to share the same UTC offsetat all times". If some little village in Vermont decides to start Daylight Saving Time five minutes earlier than the rest of the state, that guarantee is broken for Vermont w/r/t that little village, and the village has just become its own time zone for all practical purposes. And practical purposes are the only ones that interest me when I've got a ship date breathing down my neck.

The standard library that ships with your operating system almost certainly doesn't have the complete picture; that which ships with Windows is okay for the most part, but don't trust your laptop clock if you've got any important meetings on Kwajalein. You'll show up a day early. Furthermore, rarely does a year go by when somebody, somewhere, doesn't enact a new law and render your information obsolete.

Hooray for Red China: The whole damn country is UTC+8:00, with no DST anywhere.

Going by the pragmatic definition outlined above, there are roughly five hundred and twenty-nine (529) time zones on Earth as of Spring, 2001. That's not a typo. I may have missed a few.

In its infinite wisdom, the United States Navy has assigned
a letter of the alphabet to each time zone. Contrary to what one might expect, the zones don't start at "A" and wrap continuously around the earth. To add to the confusion, each time zone is referred to by its "phonetic" name, used to avoid confusion over the radio: