代码片段:默认时区下拉菜单以国家名输出
时间:2011-05-27 来源:猫之良品
system.module :
function _system_zonelist() {
$timezoneArr = array();
$timezoneArr []= array('(GMT -12:00) Eniwetok, Kwajalein', -12);
$timezoneArr []= array('(GMT -11:00) Midway Island, Samoa', -11);
$timezoneArr []= array('(GMT -10:00) Hawaii', -10);
$timezoneArr []= array('(GMT -9:00) Alaska', -9);
$timezoneArr []= array('(GMT -8:00) Pacific Time (US + Canada)', -8);
$timezoneArr []= array('(GMT -7:00) Mountain Time (US + Canada)', -7);
$timezoneArr []= array('(GMT -6:00) Central Time (US + Canada), Mexico City', -6);
$timezoneArr []= array('(GMT -5:00) Eastern Time (US + Canada), Bogota, Lima', -5);
$timezoneArr []= array('(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz', -4);
$timezoneArr []= array('(GMT -3:30) Newfoundland', -3.5);
$timezoneArr []= array('(GMT -3:00) Brazil, Buenos Aires, Georgetown', -3);
$timezoneArr []= array('(GMT -2:00) Mid-Atlantic', -2);
$timezoneArr []= array('(GMT -1:00) Azores, Cape Verde Islands', -1);
$timezoneArr []= array('(GMT -0:00) London, Western Europe, Lisbon, Casablanca', 0);
$timezoneArr []= array('(GMT +1:00) Brussels, Copenhagen, Madrid, Paris', 1);
$timezoneArr []= array('(GMT +2:00) Kaliningrad, South Africa', 2);
$timezoneArr []= array('(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg', 3);
$timezoneArr []= array('(GMT +3:30) Tehran', 3.5);
$timezoneArr []= array('(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi', 4);
$timezoneArr []= array('(GMT +4:30) Kabul', 4.5);
$timezoneArr []= array('(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent', 5);
$timezoneArr []= array('(GMT +5:30) Bombay, Calcutta, Madras, New Delhi', 5.5);
$timezoneArr []= array('(GMT +5:45) Kathmandu', 5.75);
$timezoneArr []= array('(GMT +6:00) Almaty, Dhaka, Colombo', 6);
$timezoneArr []= array('(GMT +7:00) Bangkok, Hanoi, Jakarta', 7);
$timezoneArr []= array('(GMT +8:00) Beijing, Perth, Singapore, Hong Kong', 8);
$timezoneArr []= array('(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk', 9);
$timezoneArr []= array('(GMT +9:30) Adelaide, Darwin', 9.5);
$timezoneArr []= array('(GMT +10:00) Eastern Australia, Guam, Vladivostok', 10);
$timezoneArr []= array('(GMT +11:00) Magadan, Solomon Islands, New Caledonia', 11);
$timezoneArr []= array('(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka', 12);
$zones = array();
foreach($timezoneArr as $tz) {
$zones [$tz[1] * 3600]= $tz[0];
}
return $zones;
}
相关阅读 更多 +