You are here

function date_timezone_is_valid in Date 6.2

Same name and namespace in other branches
  1. 5.2 date_api.module \date_timezone_is_valid()
  2. 7.3 date_api/date_api.module \date_timezone_is_valid()
  3. 7 date_api/date_api.module \date_timezone_is_valid()
  4. 7.2 date_api/date_api.module \date_timezone_is_valid()
3 calls to date_timezone_is_valid()
date_ical_parse_date in ./date_api_ical.inc
Parses a ical date element.
date_make_date in ./date_api.module
Convert a date of any type or an array of date parts into a valid date object.
date_php4.inc in date_php4/date_php4.inc

File

./date_api.module, line 890
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Code

function date_timezone_is_valid($timezone) {
  static $timezone_names;
  if (empty($timezone_names)) {
    $timezone_names = array_keys(date_timezone_names(TRUE));
  }
  if (!in_array($timezone, $timezone_names)) {
    return FALSE;
  }
  return TRUE;
}