timezone_menu()

timezone_menu([$default = 'UTC'[, $class = ''[, $name = 'timezones'[, $attributes = '']]]])

Parameters:
  • $default (string) – Timezone
  • $class (string) – Class name
  • $name (string) – Menu name
  • $attributes (mixed) – HTML attributes
Returns:

HTML drop down menu with time zones

Return type:

string

Generates a pull-down menu of timezones, like this one:

(UTC -12:00) Baker/Howland Island(UTC -11:00) Samoa Time Zone, Niue(UTC -10:00) Hawaii-Aleutian Standard Time, Cook Islands, Tahiti(UTC -9:30) Marquesas Islands(UTC -9:00) Alaska Standard Time, Gambier Islands(UTC -8:00) Pacific Standard Time, Clipperton Island(UTC -7:00) Mountain Standard Time(UTC -6:00) Central Standard Time(UTC -5:00) Eastern Standard Time, Western Caribbean Standard Time(UTC -4:30) Venezuelan Standard Time(UTC -4:00) Atlantic Standard Time, Eastern Caribbean Standard Time(UTC -3:30) Newfoundland Standard Time(UTC -3:00) Argentina, Brazil, French Guiana, Uruguay(UTC -2:00) South Georgia/South Sandwich Islands(UTC -1:00) Azores, Cape Verde Islands(UTC) Greenwich Mean Time, Western European Time(UTC +1:00) Central European Time, West Africa Time(UTC +2:00) Central Africa Time, Eastern European Time, Kaliningrad Time(UTC +3:00) Moscow Time, East Africa Time(UTC +3:30) Iran Standard Time(UTC +4:00) Azerbaijan Standard Time, Samara Time(UTC +4:30) Afghanistan(UTC +5:00) Pakistan Standard Time, Yekaterinburg Time(UTC +5:30) Indian Standard Time, Sri Lanka Time(UTC +5:45) Nepal Time(UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time(UTC +6:30) Cocos Islands, Myanmar(UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam(UTC +8:00) Australian Western Standard Time, Beijing Time, Irkutsk Time(UTC +8:45) Australian Central Western Standard Time(UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk Time(UTC +9:30) Australian Central Standard Time(UTC +10:00) Australian Eastern Standard Time, Vladivostok Time(UTC +10:30) Lord Howe Island(UTC +11:00) Srednekolymsk Time, Solomon Islands, Vanuatu(UTC +11:30) Norfolk Island(UTC +12:00) Fiji, Gilbert Islands, Kamchatka Time, New Zealand Standard Time(UTC +12:45) Chatham Islands Standard Time(UTC +13:00) Phoenix Islands Time, Tonga(UTC +14:00) Line Islands

This menu is useful if you run a membership site in which your users are allowed to set their local timezone value.

The first parameter lets you set the “selected” state of the menu. For example, to set Pacific time as the default you will do this:

echo timezone_menu('UM8');

Please see the timezone reference below to see the values of this menu.

The second parameter lets you set a CSS class name for the menu.

The fourth parameter lets you set one or more attributes on the generated select tag.

Note

The text contained in the menu is found in the following language file: language/<your_lang>/date_lang.php

doc_CodeIgniter
2016-10-15 16:32:42
Comments
Leave a Comment

Please login to continue.