mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 23:25:56 +00:00
add automatic timezone (based on client tz offset)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user