/** * _create_timezone_object_from_timezone_name * * @access protected * @param string $gmt_offset * @return string */ public static function get_timezone_string_from_gmt_offset($gmt_offset = '') { $timezone_string = 'UTC'; $gmt_offset = !empty($gmt_offset) ? $gmt_offset : get_option('gmt_offset'); if ($gmt_offset !== '') { // convert GMT offset to seconds $gmt_offset = $gmt_offset * HOUR_IN_SECONDS; // account for WP offsets that aren't valid UTC $gmt_offset = EEH_DTT_Helper::adjust_invalid_gmt_offsets($gmt_offset); // although we don't know the TZ abbreviation, we know the UTC offset $timezone_string = timezone_name_from_abbr(null, $gmt_offset); } // better have a valid timezone string by now, but if not, sigh... loop thru the timezone_abbreviations_list()... $timezone_string = $timezone_string !== false ? $timezone_string : EEH_DTT_Helper::get_timezone_string_from_abbreviations_list($gmt_offset); return $timezone_string; }