I am interested in your solution. This is my solution for 98% of the world.
- I have a Internet application?
Would like to know the UTC offset. Usually have the server domain. The
domain code is the ISO 2 character country code. (xx)
There are about 350 server domains.
4/5 of these domains do not have any daylight time. Therefore the UTC offset
is fixed based on the domain.
Their time zone can be determine by the country code.
I permit either the 2 letter or the 3 letter ISO code.
That leaves about 70 domains with daylight time.
90% have one time zone, so over 60 domains I have the rules to determine when
it is standard time and when it is daylight.
Except for Iran and Israel, they do not use the Gregorian calendar to
determine the dates
All others have rules that can be programmed. European Union has a
common set of rules for daylight. Country code can be used to determine time
zone and UTC offset for Europe.
United States, Canada, Australia, Russian have the problem because of
multiple time zones (except for Islands like New Zealand) and China covers
five times zones but is all one time zone.
United States and Canada, the states codes are unique, and therefore they can
be used to determine time zone (Arizona, Hawaii, Indiana (except three small
areas) and Saskatchewan do not have daylight which is no problem) (but have
duplicate of AST for Alaska and Atlantic Standard Time)
Australian has two territories with the same state code and Canada and US
State code. Therefore for Australia need both the country and state code.
In other words, either with the country codes or state (territory) codes, I
can determine the UTC offset for most of the world.
If anyone has a better idea, please let me know. Even without daylight one
must have a method to determine what is the UTC offset for a country.
What is your solution?
- What's your point? I don't see that you've actually stated a
solution, just restated the problem.
8601's +/-HHMM meets all the requirements of the problem...
A) It's compact, 5 characters rather than "who knows how many".
B) It is numerical, you don't need to do character comparisons and
C) It is clear, concise, and unambiguous.
Are you saying that you can take the country code from the sender's
server domain and "_guess_" the offset? That is very very bad.
One should *never* guess at anything. If you're not told
specifically, you raise an exception. Or, if the parties agreed on
using 8601, you know they meant Z.
You mentioned Arizona, do you realize that some of the indian
reservations use DST? As I understand it from a ranger at the Grand
Canyon; the Navajo don't do what the white man does and the Zuni
don't do what the Navajo do.
Do you realize that El Paso, Texas is in a different time zone from
the rest of Texas?