aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/session.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-01-23 12:22:51 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-01-23 12:22:51 +0000
commit0fc07b96cef4c9c5ba2d6fe0299333201d5cfba8 (patch)
treedd4ed9d9c04e96320ab9c0a62b6e69f27176c686 /phpBB/includes/session.php
parentc5b70d5f605202c409015597dc02c0ad07ac4122 (diff)
downloadforums-0fc07b96cef4c9c5ba2d6fe0299333201d5cfba8.tar
forums-0fc07b96cef4c9c5ba2d6fe0299333201d5cfba8.tar.gz
forums-0fc07b96cef4c9c5ba2d6fe0299333201d5cfba8.tar.bz2
forums-0fc07b96cef4c9c5ba2d6fe0299333201d5cfba8.tar.xz
forums-0fc07b96cef4c9c5ba2d6fe0299333201d5cfba8.zip
let us change the time zone and dst setting correctly (related to Bug #38775)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9301 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r--phpBB/includes/session.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index f1285c0203..5c9bcc4f88 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -2036,7 +2036,6 @@ class user extends 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'],
@@ -2049,6 +2048,9 @@ class user extends 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 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']))
@@ -2058,8 +2060,8 @@ class user extends 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))
@@ -2081,11 +2083,11 @@ class user extends 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']);
}
/**