diff --git a/application/helpers/date_helper.php b/application/helpers/date_helper.php index f30d227f..3f3f4b16 100644 --- a/application/helpers/date_helper.php +++ b/application/helpers/date_helper.php @@ -164,4 +164,24 @@ if ( ! function_exists('format_date_time')) } } +if ( ! function_exists('format_timezone')) +{ + /** + * Format a timezone string based on the current app settings. + * + * @param string $value + * + * @return string + */ + function format_timezone(string $value): string + { + /** @var EA_Controller $CI */ + $CI =& get_instance(); + + $CI->load->library('timezones'); + + return $CI->timezones->get_timezone_name($value); + } +} +