diff options
author | Chris Smith <toonarmy@phpbb.com> | 2010-07-07 23:42:54 +0100 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-03-14 22:57:30 -0400 |
commit | 1665434853fb09e70337d23955e1c9a5f3f0d19d (patch) | |
tree | a7b146dbed891e176954a302bdd0ee434e24d083 /phpBB/index.php | |
parent | af789040b8880f908df0a26d5239d07d77c34124 (diff) | |
download | forums-1665434853fb09e70337d23955e1c9a5f3f0d19d.tar forums-1665434853fb09e70337d23955e1c9a5f3f0d19d.tar.gz forums-1665434853fb09e70337d23955e1c9a5f3f0d19d.tar.bz2 forums-1665434853fb09e70337d23955e1c9a5f3f0d19d.tar.xz forums-1665434853fb09e70337d23955e1c9a5f3f0d19d.zip |
[feature/new-tz-handling] Remove code using legacy timezone properties.
Code accessing the legacy user::$timezone and user::$dst properties
has been removed and replaced with code utilising user::create_datetime().
Changed by Oleg:
in viewtopic, memberlist and index use getTimestamp() + getOffset().
We show members that have birthdays on the specified date.
getTimestamp() returns the current date in UTC. We add getOffset() to
obtain the current local time in the viewing user's timezone.
Then we find members having birthday on this date.
Changed by Oleg again:
Take leap year status out of the datetime object we have, this seems
like it should work as one would expect.
PHPBB3-9558
Diffstat (limited to 'phpBB/index.php')
-rw-r--r-- | phpBB/index.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/phpBB/index.php b/phpBB/index.php index 182efbc7e0..ccefd9833c 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -84,11 +84,12 @@ $legend = implode(', ', $legend); $birthday_list = array(); if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) { - $now = phpbb_gmgetdate(time() + $user->timezone + $user->dst); + $time = $user->create_datetime(); + $now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset()); // Display birthdays of 29th february on 28th february in non-leap-years $leap_year_birthdays = ''; - if ($now['mday'] == 28 && $now['mon'] == 2 && !$user->format_date(time(), 'L')) + if ($now['mday'] == 28 && $now['mon'] == 2 && !$time->format('L')) { $leap_year_birthdays = " OR user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'"; } |