aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/user.php')
-rw-r--r--phpBB/phpbb/user.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index 4e90044395..ea98034434 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -31,6 +31,11 @@ class user extends \phpbb\session
*/
public $timezone;
+ /**
+ * @var string Class name of datetime object
+ */
+ protected $datetime;
+
var $lang_name = false;
var $lang_id = false;
var $lang_path;
@@ -42,12 +47,14 @@ class user extends \phpbb\session
/**
* Constructor to set the lang path
+ * @param string $datetime_class Class name of datetime class
*/
- function __construct()
+ function __construct($datetime_class)
{
global $phpbb_root_path;
$this->lang_path = $phpbb_root_path . 'language/';
+ $this->datetime = $datetime_class;
}
/**
@@ -727,7 +734,7 @@ class user extends \phpbb\session
public function create_datetime($time = 'now', \DateTimeZone $timezone = null)
{
$timezone = $timezone ?: $this->timezone;
- return new \phpbb\datetime($this, $time, $timezone);
+ return new $this->datetime($this, $time, $timezone);
}
/**