summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/functions.php b/include/functions.php
index b54187e18..4272c649d 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -862,13 +862,18 @@
$user_tz_string = get_pref('USER_TIMEZONE', $owner_uid);
- try {
- if (!$user_tz) $user_tz = new DateTimeZone($user_tz_string);
- } catch (Exception $e) {
- $user_tz = $utc_tz;
- }
+ if ($user_tz_string != 'Automatic') {
- $tz_offset = $user_tz->getOffset($dt);
+ try {
+ if (!$user_tz) $user_tz = new DateTimeZone($user_tz_string);
+ } catch (Exception $e) {
+ $user_tz = $utc_tz;
+ }
+
+ $tz_offset = $user_tz->getOffset($dt);
+ } else {
+ $tz_offset = (int) $_SESSION["clientTzOffset"];
+ }
$user_timestamp = $dt->format('U') + $tz_offset;