PHP Doku:: Amerika - timezones.america.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatums- und zeitrelevante ErweiterungenDatum und UhrzeitListe unterstützter ZeitzonenAmerika

Ein Service von Reinhard Neidl - Webprogrammierung.

Liste unterstützter Zeitzonen

<<Afrika

Antarktis>>

Amerika

Amerika
America/Adak America/Anchorage America/Anguilla America/Antigua America/Araguaina
America/Argentina/Buenos_Aires America/Argentina/Catamarca America/Argentina/ComodRivadavia America/Argentina/Cordoba America/Argentina/Jujuy
America/Argentina/La_Rioja America/Argentina/Mendoza America/Argentina/Rio_Gallegos America/Argentina/Salta America/Argentina/San_Juan
America/Argentina/San_Luis America/Argentina/Tucuman America/Argentina/Ushuaia America/Aruba America/Asuncion
America/Atikokan America/Atka America/Bahia America/Bahia_Banderas America/Barbados
America/Belem America/Belize America/Blanc-Sablon America/Boa_Vista America/Bogota
America/Boise America/Buenos_Aires America/Cambridge_Bay America/Campo_Grande America/Cancun
America/Caracas America/Catamarca America/Cayenne America/Cayman America/Chicago
America/Chihuahua America/Coral_Harbour America/Cordoba America/Costa_Rica America/Cuiaba
America/Curacao America/Danmarkshavn America/Dawson America/Dawson_Creek America/Denver
America/Detroit America/Dominica America/Edmonton America/Eirunepe America/El_Salvador
America/Ensenada America/Fort_Wayne America/Fortaleza America/Glace_Bay America/Godthab
America/Goose_Bay America/Grand_Turk America/Grenada America/Guadeloupe America/Guatemala
America/Guayaquil America/Guyana America/Halifax America/Havana America/Hermosillo
America/Indiana/Indianapolis America/Indiana/Knox America/Indiana/Marengo America/Indiana/Petersburg America/Indiana/Tell_City
America/Indiana/Vevay America/Indiana/Vincennes America/Indiana/Winamac America/Indianapolis America/Inuvik
America/Iqaluit America/Jamaica America/Jujuy America/Juneau America/Kentucky/Louisville
America/Kentucky/Monticello America/Knox_IN America/La_Paz America/Lima America/Los_Angeles
America/Louisville America/Maceio America/Managua America/Manaus America/Marigot
America/Martinique America/Matamoros America/Mazatlan America/Mendoza America/Menominee
America/Merida America/Mexico_City America/Miquelon America/Moncton America/Monterrey
America/Montevideo America/Montreal America/Montserrat America/Nassau America/New_York
America/Nipigon America/Nome America/Noronha America/North_Dakota/Center America/North_Dakota/New_Salem
America/Ojinaga America/Panama America/Pangnirtung America/Paramaribo America/Phoenix
America/Port-au-Prince America/Port_of_Spain America/Porto_Acre America/Porto_Velho America/Puerto_Rico
America/Rainy_River America/Rankin_Inlet America/Recife America/Regina America/Resolute
America/Rio_Branco America/Rosario America/Santa_Isabel America/Santarem America/Santiago
America/Santo_Domingo America/Sao_Paulo America/Scoresbysund America/Shiprock America/St_Barthelemy
America/St_Johns America/St_Kitts America/St_Lucia America/St_Thomas America/St_Vincent
America/Swift_Current America/Tegucigalpa America/Thule America/Thunder_Bay America/Tijuana
America/Toronto America/Tortola America/Vancouver America/Virgin America/Whitehorse
America/Winnipeg America/Yakutat America/Yellowknife    

6 BenutzerBeiträge:
- Beiträge aktualisieren...
Anonymous
1.12.2010 9:03
putenv("TZ=US/Eastern");

thats what i was looking for ... just to help others out ;)
mrbinky3000
20.08.2009 0:43
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',
);
?>
Ed
29.05.2009 10:59
Look under the "Other" section for zones like "US/Central" or "US/Arizona" if by city doesn't work for you.
cjacunad at gmail dot com
19.09.2008 1:28
You can set a default time zone for your server from the configuration file (php.ini) at the line:

[Date]
; Defines the default timezone used by the date functions
date.timezone = America/New_York
ramesh638co at hotmail dot com
26.08.2008 13:46
if u want to display date and time of ur country the use this code. here i use New York of america as example...

Code:

<?php
date_default_timezone_set
('America/New_York');
 echo
date('D,F j, Y, h:i:s A');
?>

output:

Tue,August 26, 2008, 07:35:01 AM
kapahala11 at yahoo dot com
12.06.2007 3:48
Note that "America" means "the continents of North and South America, including the Caribbean islands".  It does *not* mean "The United States Of America".

If you're looking for the Hawaii timezone, you'll find it in Pacific/Honolulu (not America/Honolulu).



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)