note 93028 modified in timezones.america by danbrown

From: Date: Thu, 20 Aug 2009 04:38:59 +0000
Subject: note 93028 modified in timezones.america by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-159674@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. <?php // 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', ); ?> --was-- 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', ); http://php.net/manual/en/timezones.america.php

« previous php.notes (#159674) next »