home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (date_api.admin.inc)

This example Drupal source code file (date_api.admin.inc) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

america/boise, america/chicago, america/los_angeles, america/new_york, america/phoenix, array, europe/belfast, function, old, pacific/honolulu, php, replace, return, utc

The date_api.admin.inc Drupal example source code

<?php

/**
 * @file
 * Administrative page callbacks for the date_api module.
 */

/**
 * Create replacement values for deprecated timezone names.
 */
function _date_timezone_replacement($old) {
  $replace = array (
  'Brazil/Acre' => 'America/Rio_Branco',
  'Brazil/DeNoronha' => 'America/Noronha',
  'Brazil/East' => 'America/Recife',
  'Brazil/West' => 'America/Manaus',
  'Canada/Atlantic' => 'America/Halifax',
  'Canada/Central' => 'America/Winnipeg',
  'Canada/East-Saskatchewan' => 'America/Regina',
  'Canada/Eastern' => 'America/Toronto',
  'Canada/Mountain' =>'America/Edmonton',
  'Canada/Newfoundland' => 'America/St_Johns',
  'Canada/Pacific' => 'America/Vancouver',
  'Canada/Saskatchewan' => 'America/Regina',
  'Canada/Yukon' => 'America/Whitehorse',
  'CET' => 'Europe/Berlin',
  'Chile/Continental' => 'America/Santiago',
  'Chile/EasterIsland' => 'Pacific/Easter',
  'CST6CDT' => 'America/Chicago',
  'Cuba' => 'America/Havana',
  'EET' => 'Europe/Bucharest',
  'Egypt' => 'Africa/Cairo',
  'Eire' => 'Europe/Belfast',
  'EST' => 'America/New_York',
  'EST5EDT' => 'America/New_York',
  'GB' => 'Europe/London',
  'GB-Eire' => 'Europe/Belfast',
  'Etc/GMT' => 'UTC',
  'Etc/GMT+0' => 'UTC',
  'Etc/GMT+1' => 'UTC',
  'Etc/GMT+10' => 'UTC',
  'Etc/GMT+11' => 'UTC',
  'Etc/GMT+12' => 'UTC',
  'Etc/GMT+2' => 'UTC',
  'Etc/GMT+3' => 'UTC',
  'Etc/GMT+4' => 'UTC',
  'Etc/GMT+5' => 'UTC',
  'Etc/GMT+6' => 'UTC',
  'Etc/GMT+7' => 'UTC',
  'Etc/GMT+8' => 'UTC',
  'Etc/GMT+9' => 'UTC',
  'Etc/GMT-0' => 'UTC',
  'Etc/GMT-1' => 'UTC',
  'Etc/GMT-10' => 'UTC',
  'Etc/GMT-11' => 'UTC',
  'Etc/GMT-12' => 'UTC',
  'Etc/GMT-13' => 'UTC',
  'Etc/GMT-14' => 'UTC',
  'Etc/GMT-2' => 'UTC',
  'Etc/GMT-3' => 'UTC',
  'Etc/GMT-4' => 'UTC',
  'Etc/GMT-5' => 'UTC',
  'Etc/GMT-6' => 'UTC',
  'Etc/GMT-7' => 'UTC',
  'Etc/GMT-8' => 'UTC',
  'Etc/GMT-9' => 'UTC',
  'Etc/GMT0' => 'UTC',
  'Etc/Greenwich' => 'UTC',
  'Etc/UCT' => 'UTC',
  'Etc/Universal' => 'UTC',
  'Etc/UTC' => 'UTC',
  'Etc/Zulu' => 'UTC',
  'Factory' => 'UTC',
  'GMT' => 'UTC',
  'GMT+0' => 'UTC',
  'GMT-0' => 'UTC',
  'GMT0' => 'UTC',
  'Hongkong' => 'Asia/Hong_Kong',
  'HST' => 'Pacific/Honolulu',
  'Iceland' => 'Atlantic/Reykjavik',
  'Iran' => 'Asia/Tehran',
  'Israel' => 'Asia/Tel_Aviv',
  'Jamaica' => 'America/Jamaica',
  'Japan' => 'Asia/Tokyo',
  'Kwajalein' => 'Pacific/Kwajalein',
  'Libya' => 'Africa/Tunis',
  'MET' => 'Europe/Budapest',
  'Mexico/BajaNorte' => 'America/Tijuana',
  'Mexico/BajaSur' => 'America/Mazatlan',
  'Mexico/General' => 'America/Mexico_City',
  'MST' => 'America/Boise',
  'MST7MDT' => 'America/Boise',
  'Navajo' => 'America/Phoenix',
  'NZ' => 'Pacific/Auckland',
  'NZ-CHAT' => 'Pacific/Chatham',
  'Poland' => 'Europe/Warsaw',
  'Portugal' => 'Europe/Lisbon',
  'PRC' => 'Asia/Chongqing',
  'PST8PDT' => 'America/Los_Angeles',
  'ROC' => 'Asia/Taipei',
  'ROK' => 'Asia/Seoul',
  'Singapore' =>'Asia/Singapore',
  'Turkey' => 'Europe/Istanbul',
  'US/Alaska' => 'America/Anchorage',
  'US/Aleutian' => 'America/Adak',
  'US/Arizona' => 'America/Phoenix',
  'US/Central' => 'America/Chicago',
  'US/East-Indiana' => 'America/Indianapolis',
  'US/Eastern' => 'America/New_York',
  'US/Hawaii' => 'Pacific/Honolulu',
  'US/Indiana-Starke' => 'America/Indiana/Knox',
  'US/Michigan' => 'America/Detroit',
  'US/Mountain' => 'America/Boise',
  'US/Pacific' => 'America/Los_Angeles',
  'US/Pacific-New' => 'America/Los_Angeles',
  'US/Samoa' => 'Pacific/Samoa',
  'W-SU' => 'Europe/Moscow',
  'WET' => 'Europe/Paris',
  );
  if (array_key_exists($old, $replace)) {
    return $replace[$old];
  }
  else {
    return $old;
  }
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal date_api.admin.inc source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.