当前位置: 首页>>代码示例>>PHP>>正文


PHP core_date::bczones方法代码示例

本文整理汇总了PHP中core_date::bczones方法的典型用法代码示例。如果您正苦于以下问题:PHP core_date::bczones方法的具体用法?PHP core_date::bczones怎么用?PHP core_date::bczones使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core_date的用法示例。


在下文中一共展示了core_date::bczones方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init_zones

 /**
  * Initialise timezone arrays, call before use.
  */
 protected static function init_zones()
 {
     if (isset(self::$goodzones)) {
         return;
     }
     $zones = DateTimeZone::listIdentifiers();
     self::$goodzones = array_fill_keys($zones, true);
     $zones = DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC);
     self::$bczones = array();
     foreach ($zones as $zone) {
         if (isset(self::$goodzones[$zone])) {
             continue;
         }
         self::$bczones[$zone] = true;
     }
     self::$badzones = array('Dateline Standard Time' => 'Etc/GMT+12', 'Hawaiian Standard Time' => 'Pacific/Honolulu', 'Alaskan Standard Time' => 'America/Anchorage', 'Pacific Standard Time (Mexico)' => 'America/Santa_Isabel', 'Pacific Standard Time' => 'America/Los_Angeles', 'US Mountain Standard Time' => 'America/Phoenix', 'Mountain Standard Time (Mexico)' => 'America/Chihuahua', 'Mountain Standard Time' => 'America/Denver', 'Central America Standard Time' => 'America/Guatemala', 'Central Standard Time' => 'America/Chicago', 'Central Standard Time (Mexico)' => 'America/Mexico_City', 'Canada Central Standard Time' => 'America/Regina', 'SA Pacific Standard Time' => 'America/Bogota', 'Eastern Standard Time' => 'America/New_York', 'US Eastern Standard Time' => 'America/Indianapolis', 'Venezuela Standard Time' => 'America/Caracas', 'Paraguay Standard Time' => 'America/Asuncion', 'Atlantic Standard Time' => 'America/Halifax', 'Central Brazilian Standard Time' => 'America/Cuiaba', 'SA Western Standard Time' => 'America/La_Paz', 'Pacific SA Standard Time' => 'America/Santiago', 'Newfoundland Standard Time' => 'America/St_Johns', 'E. South America Standard Time' => 'America/Sao_Paulo', 'Argentina Standard Time' => 'America/Buenos_Aires', 'SA Eastern Standard Time' => 'America/Cayenne', 'Greenland Standard Time' => 'America/Godthab', 'Montevideo Standard Time' => 'America/Montevideo', 'Bahia Standard Time' => 'America/Bahia', 'Azores Standard Time' => 'Atlantic/Azores', 'Cape Verde Standard Time' => 'Atlantic/Cape_Verde', 'Morocco Standard Time' => 'Africa/Casablanca', 'GMT Standard Time' => 'Europe/London', 'Greenwich Standard Time' => 'Atlantic/Reykjavik', 'W. Europe Standard Time' => 'Europe/Berlin', 'Central Europe Standard Time' => 'Europe/Budapest', 'Romance Standard Time' => 'Europe/Paris', 'Central European Standard Time' => 'Europe/Warsaw', 'W. Central Africa Standard Time' => 'Africa/Lagos', 'Namibia Standard Time' => 'Africa/Windhoek', 'Jordan Standard Time' => 'Asia/Amman', 'GTB Standard Time' => 'Europe/Bucharest', 'Middle East Standard Time' => 'Asia/Beirut', 'Egypt Standard Time' => 'Africa/Cairo', 'Syria Standard Time' => 'Asia/Damascus', 'South Africa Standard Time' => 'Africa/Johannesburg', 'FLE Standard Time' => 'Europe/Kiev', 'Turkey Standard Time' => 'Europe/Istanbul', 'Israel Standard Time' => 'Asia/Jerusalem', 'Kaliningrad Standard Time' => 'Europe/Kaliningrad', 'Libya Standard Time' => 'Africa/Tripoli', 'Arabic Standard Time' => 'Asia/Baghdad', 'Arab Standard Time' => 'Asia/Riyadh', 'Belarus Standard Time' => 'Europe/Minsk', 'Russian Standard Time' => 'Europe/Moscow', 'E. Africa Standard Time' => 'Africa/Nairobi', 'Iran Standard Time' => 'Asia/Tehran', 'Arabian Standard Time' => 'Asia/Dubai', 'Azerbaijan Standard Time' => 'Asia/Baku', 'Russia Time Zone 3' => 'Europe/Samara', 'Mauritius Standard Time' => 'Indian/Mauritius', 'Georgian Standard Time' => 'Asia/Tbilisi', 'Caucasus Standard Time' => 'Asia/Yerevan', 'Afghanistan Standard Time' => 'Asia/Kabul', 'West Asia Standard Time' => 'Asia/Tashkent', 'Ekaterinburg Standard Time' => 'Asia/Yekaterinburg', 'Pakistan Standard Time' => 'Asia/Karachi', 'India Standard Time' => 'Asia/Kolkata', 'Sri Lanka Standard Time' => 'Asia/Colombo', 'Nepal Standard Time' => 'Asia/Katmandu', 'Central Asia Standard Time' => 'Asia/Almaty', 'Bangladesh Standard Time' => 'Asia/Dhaka', 'N. Central Asia Standard Time' => 'Asia/Novosibirsk', 'Myanmar Standard Time' => 'Asia/Rangoon', 'SE Asia Standard Time' => 'Asia/Bangkok', 'North Asia Standard Time' => 'Asia/Krasnoyarsk', 'China Standard Time' => 'Asia/Shanghai', 'North Asia East Standard Time' => 'Asia/Irkutsk', 'Singapore Standard Time' => 'Asia/Singapore', 'W. Australia Standard Time' => 'Australia/Perth', 'Taipei Standard Time' => 'Asia/Taipei', 'Ulaanbaatar Standard Time' => 'Asia/Ulaanbaatar', 'Tokyo Standard Time' => 'Asia/Tokyo', 'Korea Standard Time' => 'Asia/Seoul', 'Yakutsk Standard Time' => 'Asia/Yakutsk', 'Cen. Australia Standard Time' => 'Australia/Adelaide', 'AUS Central Standard Time' => 'Australia/Darwin', 'E. Australia Standard Time' => 'Australia/Brisbane', 'AUS Eastern Standard Time' => 'Australia/Sydney', 'West Pacific Standard Time' => 'Pacific/Port_Moresby', 'Tasmania Standard Time' => 'Australia/Hobart', 'Magadan Standard Time' => 'Asia/Magadan', 'Vladivostok Standard Time' => 'Asia/Vladivostok', 'Russia Time Zone 10' => 'Asia/Srednekolymsk', 'Central Pacific Standard Time' => 'Pacific/Guadalcanal', 'Russia Time Zone 11' => 'Asia/Kamchatka', 'New Zealand Standard Time' => 'Pacific/Auckland', 'Fiji Standard Time' => 'Pacific/Fiji', 'Tonga Standard Time' => 'Pacific/Tongatapu', 'Samoa Standard Time' => 'Pacific/Apia', 'Line Islands Standard Time' => 'Pacific/Kiritimati', 'CET' => 'Europe/Berlin', 'Central European Time' => 'Europe/Berlin', 'CST' => 'America/Chicago', 'Central Time' => 'America/Chicago', 'CST6CDT' => 'America/Chicago', 'CDT' => 'America/Chicago', 'China Time' => 'Asia/Shanghai', 'EDT' => 'America/New_York', 'EST' => 'America/New_York', 'EST5EDT' => 'America/New_York', 'Eastern Time' => 'America/New_York', 'IST' => 'Asia/Kolkata', 'India Time' => 'Asia/Kolkata', 'JST' => 'Asia/Tokyo', 'Japan Time' => 'Asia/Tokyo', 'Japan Standard Time' => 'Asia/Tokyo', 'MDT' => 'America/Denver', 'MST' => 'America/Denver', 'MST7MDT' => 'America/Denver', 'PDT' => 'America/Los_Angeles', 'PST' => 'America/Los_Angeles', 'Pacific Time' => 'America/Los_Angeles', 'PST8PDT' => 'America/Los_Angeles', 'HST' => 'Pacific/Honolulu', 'WET' => 'Europe/London', 'EET' => 'Europe/Kiev', 'FET' => 'Europe/Minsk', 'UTC-01' => 'Etc/GMT+1', 'UTC-02' => 'Etc/GMT+2', 'UTC-03' => 'Etc/GMT+3', 'UTC-04' => 'Etc/GMT+4', 'UTC-05' => 'Etc/GMT+5', 'UTC-06' => 'Etc/GMT+6', 'UTC-07' => 'Etc/GMT+7', 'UTC-08' => 'Etc/GMT+8', 'UTC-09' => 'Etc/GMT+9', 'Etc/GMT+0' => 'Etc/GMT', 'Etc/GMT-0' => 'Etc/GMT', 'Etc/GMT0' => 'Etc/GMT', 'Asia/Calcutta' => 'Asia/Kolkata');
     // Legacy GMT fallback.
     for ($i = -14; $i <= 13; $i++) {
         $off = abs($i);
         if ($i < 0) {
             $mapto = 'Etc/GMT+' . $off;
             $utc = 'UTC-' . $off;
             $gmt = 'GMT-' . $off;
         } else {
             if ($i > 0) {
                 $mapto = 'Etc/GMT-' . $off;
                 $utc = 'UTC+' . $off;
                 $gmt = 'GMT+' . $off;
             } else {
                 $mapto = 'Etc/GMT';
                 $utc = 'UTC';
                 $gmt = 'GMT';
             }
         }
         if (isset(self::$bczones[$mapto])) {
             self::$badzones[$i . ''] = $mapto;
             self::$badzones[$i . '.0'] = $mapto;
             self::$badzones[$utc] = $mapto;
             self::$badzones[$gmt] = $mapto;
         }
     }
     // Legacy Moodle half an hour offsets - pick any city nearby, ideally without DST.
     self::$badzones['-4.5'] = 'America/Caracas';
     self::$badzones['4.5'] = 'Asia/Kabul';
     self::$badzones['5.5'] = 'Asia/Kolkata';
     self::$badzones['6.5'] = 'Asia/Rangoon';
     self::$badzones['9.5'] = 'Australia/Darwin';
     // Remove bad zones that are elsewhere.
     foreach (self::$bczones as $zone => $unused) {
         if (isset(self::$badzones[$zone])) {
             unset(self::$badzones[$zone]);
         }
     }
     foreach (self::$goodzones as $zone => $unused) {
         if (isset(self::$badzones[$zone])) {
             unset(self::$badzones[$zone]);
         }
     }
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:62,代码来源:date.php


注:本文中的core_date::bczones方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。