Everyone:

I'd like to invite you all to examine this code:

    static private $m_tz = array("A" => 1, "ACDT" => 10.5, "ACST" => 
9.5, "ADT" => -3, "AEDT" => 11,
        "AEST" => 10, "AKDT" => -8, "AKST" => -9, "AST" => -4, "AWDT" => 
9, "AWST" => 8,
        "B" => 2, "BST" => 1, "C" => 3, "CDT" => -5, "CEDT" => 2, "CEST" 
=> 2,
        "CET" => 1, "CST" => -6, "CXT" => 7, "D" => 4, "E" => 5, "EDT" 
=> -4,
        "EEDT" => 3, "EEST" => 3, "EET" => 2, "EST" => -5, "F" => 6, "G" 
=> 7,
        "GMT" => 0, "H" => 8, "HAA" => -3, "HAC" => -5, "HADT" => -9, 
"HAE" => -4,
        "HAP" => -7, "HAR" => -6, "HAST" => -10, "HAT" => -2.5, "HAY" => -8,
        "HNA" => -4, "HNC" => -6, "HNE" => -5, "HNP" => -8, "HNR" => -7, 
"HNT" => -3.5,
        "HNY" => -9, "I" => 9, "IST" => 1, "K" => 10, "L" => 11, "M" => 12,
        "MDT" => -6, "MESZ" => 2, "MEZ" => 1, "MSD" => 4, "MSK" => 3, 
"MST" => -7,
        "N" => -1, "NDT" => -2.5, "NFT" => 11.5, "NST" => -3.5, "O" => 
-2, "P" => -3,
        "PDT" => -7, "PST" => -8, "Q" => -4, "R" => -5, "S" -> -6, "T" 
=> -7,
        "U" => -8, "UTC" => 0, "V" => -9, "W" => -10, "WDT" => 9, "WEDT" 
=> 1,
        "WEST" => 1, "WET" => 0, "WST" => 8, "X" => -11, "Y" => -12, "Z" 
=> 0);

It is an array that furnishes time offsets for every known time-zone 
abbreviation, in its most commonly-used meaning. (For example, "EST" is 
taken to mean "Eastern Standard Time" in North America, not Australia.) 
It uses the symbol as the key and returns a direct time offset. The 
source for this is:

<http://timeanddate.com/library/abbreviations/timezones/>

This includes a number of acronyms that derive from French, German, and 
presumably Russian, as well as English. It also uses letters of the 
alphabet to stand for the military time zones.

Now all I need to do is compose a regular expression to yield the 
symbol, and then I can get the offset by a simple array call.

Temlakos

------------------------------------------------------------------------------
_______________________________________________
Semediawiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to