1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-09 10:16:36 +02:00

[feature/new-tz-handling] Rename $user->tz back to $user->timezone

PHPBB3-9558
This commit is contained in:
Joas Schilling
2012-07-18 16:52:52 +02:00
parent 515e1662a9
commit a71e60cdbd
5 changed files with 13 additions and 13 deletions

View File

@@ -33,7 +33,7 @@ class phpbb_user extends phpbb_session
/**
* DateTimeZone object holding the timezone of the user
*/
public $tz;
public $timezone;
var $lang_name = false;
var $lang_id = false;
@@ -127,7 +127,7 @@ class phpbb_user extends phpbb_session
*/
}
$this->tz = new DateTimeZone($user_timezone);
$this->timezone = new DateTimeZone($user_timezone);
// We include common language file here to not load it every time a custom language file is included
$lang = &$this->lang;
@@ -623,7 +623,7 @@ class phpbb_user extends phpbb_session
}
$time = new phpbb_datetime($this, "@$gmepoch", $utc);
$time->setTimezone($this->tz);
$time->setTimezone($this->timezone);
return $time->format($format, $forcedate);
}
@@ -638,7 +638,7 @@ class phpbb_user extends phpbb_session
*/
public function create_datetime($time = 'now', DateTimeZone $timezone = null)
{
$timezone = $timezone ?: $this->tz;
$timezone = $timezone ?: $this->timezone;
return new phpbb_datetime($this, $time, $timezone);
}
@@ -652,7 +652,7 @@ class phpbb_user extends phpbb_session
*/
public function get_timestamp_from_format($format, $time, DateTimeZone $timezone = null)
{
$timezone = $timezone ?: $this->tz;
$timezone = $timezone ?: $this->timezone;
$date = DateTime::createFromFormat($format, $time, $timezone);
return ($date !== false) ? $date->format('U') : false;
}