From a57a96cbddbfdad65823aeca2901f26b62c9b12d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 10 Aug 2014 12:55:49 +0200 Subject: [ticket/12932] Add method for getting the datetime class and allow overriding An extension can now override the datetime class by overwriting the datetime.class parameter in their own yml file. PHPBB3-12932 --- phpBB/includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bd0a5795b1..065f38f4dc 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1061,7 +1061,7 @@ function phpbb_timezone_select($user, $default = '', $truncate = false) foreach ($unsorted_timezones as $timezone) { $tz = new DateTimeZone($timezone); - $dt = new \phpbb\datetime($user, 'now', $tz); + $dt = $user->create_datetime($user, 'now', $tz); $offset = $dt->getOffset(); $current_time = $dt->format($user->lang['DATETIME_FORMAT'], true); $offset_string = phpbb_format_timezone_offset($offset); @@ -4881,7 +4881,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id = } } - $dt = new \phpbb\datetime($user, 'now', $user->timezone); + $dt = $user->create_datetime($user, 'now', $user->timezone); $timezone_offset = 'GMT' . phpbb_format_timezone_offset($dt->getOffset()); $timezone_name = $user->timezone->getName(); if (isset($user->lang['timezones'][$timezone_name])) -- cgit v1.2.1