diff --git a/clock.module b/clock.module index 7e95651..7d3fe9a 100755 --- a/clock.module +++ b/clock.module @@ -105,7 +105,7 @@ function clock_block($op = 'list', $delta = 0, $edit = array()) { ); // Format the current time with each of the three default date formats to display them in the form. - $timezone = clock_get_timezone(); + $timezone = clock_get_timezone(TRUE); $short = date_format_date(date_now($timezone), $type = 'short'); $medium = date_format_date(date_now($timezone), $type = 'medium'); $long = date_format_date(date_now($timezone), $type = 'long'); @@ -200,12 +200,16 @@ function clock_theme() { /** * Gets the correct time zone. * + * @param $date_format_date + * Whether or not the returned time zone is directly used in + * date_format_date(). Defaults to FALSE. + * * @return * A string containing the time zone name or NULL if the time zone type is * 'User time zone'. If the time zone type is 'Local time zone' the string * 'Local' is returned. */ -function clock_get_timezone() { +function clock_get_timezone($date_format_date = FALSE) { $timezone_type = variable_get('clock_timezone_type', '1'); switch ($timezone_type) { @@ -219,7 +223,7 @@ function clock_get_timezone() { break; // Local time zone. case '3': - $timezone = 'Local'; + $timezone = ($date_format_date ? variable_get('date_default_timezone_name', 'UTC') : 'Local'); break; // Custom time zone. case '4':