Moves $timeNow as early as possible. Available to whole site.
parent
49ba04bffa
commit
f4238f205f
|
|
@ -3,9 +3,6 @@
|
|||
<!-- Sidebar -->
|
||||
<div class="col-md-3 sidebar-wrapper" id="sidebar">
|
||||
<div class="text-center" id="time_now">
|
||||
<?php
|
||||
$timeNow = new DateTime('now', new DateTimeZone($userTimezone));
|
||||
?>
|
||||
<span><?= htmlspecialchars($timeNow->format('H:i')) ?> <?= htmlspecialchars($userTimezone) ?></span>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -348,6 +348,7 @@ if ($page == 'logout') {
|
|||
$userDetails = $userObject->getUserDetails($userId);
|
||||
$userRights = $userObject->getUserRights($userId);
|
||||
$userTimezone = (!empty($userDetails[0]['timezone'])) ? $userDetails[0]['timezone'] : 'UTC'; // Default to UTC if no timezone is set (or is missing)
|
||||
$timeNow = new DateTime('now', new DateTimeZone($userTimezone)); // We init local viewer's time as early as possible
|
||||
|
||||
// check if the Jilo Server is running
|
||||
require APP_PATH . 'classes/server.php';
|
||||
|
|
|
|||
Loading…
Reference in New Issue