date_api.admin.inc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. /**
  3. * @file
  4. * Administrative page callbacks for the date_api module.
  5. */
  6. /**
  7. * Create replacement values for deprecated timezone names.
  8. */
  9. function _date_timezone_replacement($old) {
  10. $replace = array(
  11. 'Brazil/Acre' => 'America/Rio_Branco',
  12. 'Brazil/DeNoronha' => 'America/Noronha',
  13. 'Brazil/East' => 'America/Recife',
  14. 'Brazil/West' => 'America/Manaus',
  15. 'Canada/Atlantic' => 'America/Halifax',
  16. 'Canada/Central' => 'America/Winnipeg',
  17. 'Canada/East-Saskatchewan' => 'America/Regina',
  18. 'Canada/Eastern' => 'America/Toronto',
  19. 'Canada/Mountain' => 'America/Edmonton',
  20. 'Canada/Newfoundland' => 'America/St_Johns',
  21. 'Canada/Pacific' => 'America/Vancouver',
  22. 'Canada/Saskatchewan' => 'America/Regina',
  23. 'Canada/Yukon' => 'America/Whitehorse',
  24. 'CET' => 'Europe/Berlin',
  25. 'Chile/Continental' => 'America/Santiago',
  26. 'Chile/EasterIsland' => 'Pacific/Easter',
  27. 'CST6CDT' => 'America/Chicago',
  28. 'Cuba' => 'America/Havana',
  29. 'EET' => 'Europe/Bucharest',
  30. 'Egypt' => 'Africa/Cairo',
  31. 'Eire' => 'Europe/Belfast',
  32. 'EST' => 'America/New_York',
  33. 'EST5EDT' => 'America/New_York',
  34. 'GB' => 'Europe/London',
  35. 'GB-Eire' => 'Europe/Belfast',
  36. 'Etc/GMT' => 'UTC',
  37. 'Etc/GMT+0' => 'UTC',
  38. 'Etc/GMT+1' => 'UTC',
  39. 'Etc/GMT+10' => 'UTC',
  40. 'Etc/GMT+11' => 'UTC',
  41. 'Etc/GMT+12' => 'UTC',
  42. 'Etc/GMT+2' => 'UTC',
  43. 'Etc/GMT+3' => 'UTC',
  44. 'Etc/GMT+4' => 'UTC',
  45. 'Etc/GMT+5' => 'UTC',
  46. 'Etc/GMT+6' => 'UTC',
  47. 'Etc/GMT+7' => 'UTC',
  48. 'Etc/GMT+8' => 'UTC',
  49. 'Etc/GMT+9' => 'UTC',
  50. 'Etc/GMT-0' => 'UTC',
  51. 'Etc/GMT-1' => 'UTC',
  52. 'Etc/GMT-10' => 'UTC',
  53. 'Etc/GMT-11' => 'UTC',
  54. 'Etc/GMT-12' => 'UTC',
  55. 'Etc/GMT-13' => 'UTC',
  56. 'Etc/GMT-14' => 'UTC',
  57. 'Etc/GMT-2' => 'UTC',
  58. 'Etc/GMT-3' => 'UTC',
  59. 'Etc/GMT-4' => 'UTC',
  60. 'Etc/GMT-5' => 'UTC',
  61. 'Etc/GMT-6' => 'UTC',
  62. 'Etc/GMT-7' => 'UTC',
  63. 'Etc/GMT-8' => 'UTC',
  64. 'Etc/GMT-9' => 'UTC',
  65. 'Etc/GMT0' => 'UTC',
  66. 'Etc/Greenwich' => 'UTC',
  67. 'Etc/UCT' => 'UTC',
  68. 'Etc/Universal' => 'UTC',
  69. 'Etc/UTC' => 'UTC',
  70. 'Etc/Zulu' => 'UTC',
  71. 'Factory' => 'UTC',
  72. 'GMT' => 'UTC',
  73. 'GMT+0' => 'UTC',
  74. 'GMT-0' => 'UTC',
  75. 'GMT0' => 'UTC',
  76. 'Hongkong' => 'Asia/Hong_Kong',
  77. 'HST' => 'Pacific/Honolulu',
  78. 'Iceland' => 'Atlantic/Reykjavik',
  79. 'Iran' => 'Asia/Tehran',
  80. 'Israel' => 'Asia/Tel_Aviv',
  81. 'Jamaica' => 'America/Jamaica',
  82. 'Japan' => 'Asia/Tokyo',
  83. 'Kwajalein' => 'Pacific/Kwajalein',
  84. 'Libya' => 'Africa/Tunis',
  85. 'MET' => 'Europe/Budapest',
  86. 'Mexico/BajaNorte' => 'America/Tijuana',
  87. 'Mexico/BajaSur' => 'America/Mazatlan',
  88. 'Mexico/General' => 'America/Mexico_City',
  89. 'MST' => 'America/Boise',
  90. 'MST7MDT' => 'America/Boise',
  91. 'Navajo' => 'America/Phoenix',
  92. 'NZ' => 'Pacific/Auckland',
  93. 'NZ-CHAT' => 'Pacific/Chatham',
  94. 'Poland' => 'Europe/Warsaw',
  95. 'Portugal' => 'Europe/Lisbon',
  96. 'PRC' => 'Asia/Chongqing',
  97. 'PST8PDT' => 'America/Los_Angeles',
  98. 'ROC' => 'Asia/Taipei',
  99. 'ROK' => 'Asia/Seoul',
  100. 'Singapore' => 'Asia/Singapore',
  101. 'Turkey' => 'Europe/Istanbul',
  102. 'US/Alaska' => 'America/Anchorage',
  103. 'US/Aleutian' => 'America/Adak',
  104. 'US/Arizona' => 'America/Phoenix',
  105. 'US/Central' => 'America/Chicago',
  106. 'US/East-Indiana' => 'America/Indianapolis',
  107. 'US/Eastern' => 'America/New_York',
  108. 'US/Hawaii' => 'Pacific/Honolulu',
  109. 'US/Indiana-Starke' => 'America/Indiana/Knox',
  110. 'US/Michigan' => 'America/Detroit',
  111. 'US/Mountain' => 'America/Boise',
  112. 'US/Pacific' => 'America/Los_Angeles',
  113. 'US/Pacific-New' => 'America/Los_Angeles',
  114. 'US/Samoa' => 'Pacific/Samoa',
  115. 'W-SU' => 'Europe/Moscow',
  116. 'WET' => 'Europe/Paris',
  117. );
  118. if (array_key_exists($old, $replace)) {
  119. return $replace[$old];
  120. }
  121. else {
  122. return $old;
  123. }
  124. }