note 93028 added to timezones.america

From: Date: Wed, 19 Aug 2009 22:43:17 +0000
Subject: note 93028 added to timezones.america
Groups: php.notes 
Request: Send a blank email to php-notes+get-159670@lists.php.net to get a copy of this message
According to the documentation on this site, we are not supposed to use timezones listed in the "Other" category like 'US/Central' and the like. They are only available for backwards compatibility. So, I assume they will go bye-bye in future versions. Some US Territories, most of Arizona, and all of Hawaii do NOT observe Daylight Savings Time. The arrays below cover all 50 states the US territories. Please note that the timezone names supported by DateTime are imported into PHP from an external database. That said, the city names might change in the future, however unlikely. So by definition these imported timezones are not 100% reliable. Timezones like EDT, CDT and the like are not pinned to the name of a city. They work but are not defined anywhere in the documentation's official "List of Supported Timezones". Who knows if they will still work in future versions of PHP. I think they will. But that's just a gut feeling. Going by timezone instead of city makes more sense to me than trying to get a map and look up which city is in which timezone. // US TimeZones based on TimeZone name // format 'DateTime Timezone' => 'Human Friendly Timezone' $aTimeZones = array( 'America/Puerto_Rico'=>'AST', 'EDT'=>'EDT', 'CDT'=>'CDT', 'America/Phoenix'=>'MST', 'MDT'=>'MDT', 'PDT'=>'PDT', 'America/Juneau'=>'AKDT', 'HST'=>'HST', 'Pacific/Guam'=>'ChST', 'Pacific/Samoa'=>'SST', 'Pacific/Wake'=>'WAKT', ); // US TimeZones according to DateTime's official "List of Supported Timezones" $aTimeZones = array( 'America/Puerto_Rico'=>'AST', 'America/New_York'=>'EDT', 'America/Chicago'=>'CDT', 'America/Boise'=>'MDT', 'America/Phoenix'=>'MST', 'America/Los_Angeles'=>'PDT', 'America/Juneau'=>'AKDT', 'Pacific/Honolulu'=>'HST', 'Pacific/Guam'=>'ChST', 'Pacific/Samoa'=>'SST', 'Pacific/Wake'=>'WAKT', ); ---- Server IP: 208.69.120.35 Probable Submitter: 24.208.177.43 ---- Manual Page -- http://www.php.net/manual/en/timezones.america.php Edit -- https://master.php.net/note/edit/93028 Del: integrated -- https://master.php.net/note/delete/93028/integrated Del: useless -- https://master.php.net/note/delete/93028/useless Del: bad code -- https://master.php.net/note/delete/93028/bad+code Del: spam -- https://master.php.net/note/delete/93028/spam Del: non-english -- https://master.php.net/note/delete/93028/non-english Del: in docs -- https://master.php.net/note/delete/93028/in+docs Del: other reasons-- https://master.php.net/note/delete/93028 Reject -- https://master.php.net/note/reject/93028 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#159670) next »