1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[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
This commit is contained in:
Chris Smith
2010-07-07 23:42:54 +01:00
committed by Oleg Pudeyev
parent af789040b8
commit 1665434853
5 changed files with 14 additions and 8 deletions

View File

@@ -965,7 +965,8 @@ $sql_ary = array(
$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
$now = phpbb_gmgetdate(time() + $user->timezone + $user->dst);
$now = $user->create_datetime();
$now = phpbb_gmgetdate($now->getTimestamp() + $now->getOffset());
// Posts are stored in the $rowset array while $attach_list, $user_cache
// and the global bbcode_bitfield are built