aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/classes/user.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/phpBB/includes/classes/user.php b/phpBB/includes/classes/user.php
index 739c338377..beba494e98 100644
--- a/phpBB/includes/classes/user.php
+++ b/phpBB/includes/classes/user.php
@@ -792,7 +792,6 @@ class phpbb_user extends phpbb_session
// Is the user requesting a friendly date format (i.e. 'Today 12:42')?
$date_cache[$format] = array(
'is_short' => strpos($format, '|'),
- 'zone_offset' => $this->timezone + $this->dst,
'format_short' => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1),
'format_long' => str_replace('|', '', $format),
'lang' => $this->lang['datetime'],
@@ -805,6 +804,9 @@ class phpbb_user extends phpbb_session
}
}
+ // Zone offset
+ $zone_offset = $this->timezone + $this->dst;
+
// Show date <= 1 hour ago as 'xx min ago'
// A small tolerence is given for times in the future and times in the future but in the same minute are displayed as '< than a minute ago'
if ($delta <= 3600 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
@@ -814,8 +816,8 @@ class phpbb_user extends phpbb_session
if (!$midnight)
{
- list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $date_cache[$format]['zone_offset']));
- $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $date_cache[$format]['zone_offset'];
+ list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $zone_offset));
+ $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $zone_offset;
}
if ($date_cache[$format]['is_short'] !== false && !$forcedate && !($gmepoch < $midnight - 86400 || $gmepoch > $midnight + 172800))
@@ -837,11 +839,11 @@ class phpbb_user extends phpbb_session
if ($day !== false)
{
- return str_replace('||', $this->lang['datetime'][$day], strtr(@gmdate($date_cache[$format]['format_short'], $gmepoch + $date_cache[$format]['zone_offset']), $date_cache[$format]['lang']));
+ return str_replace('||', $this->lang['datetime'][$day], strtr(@gmdate($date_cache[$format]['format_short'], $gmepoch + $zone_offset), $date_cache[$format]['lang']));
}
}
- return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $date_cache[$format]['zone_offset']), $date_cache[$format]['lang']);
+ return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $zone_offset), $date_cache[$format]['lang']);
}
/**