1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-11-24 08:32:50 +02:00

Merge pull request #5728 from mailcow/fix/debug-tz

[Web] fix blank /debug page with invalid timezone
This commit is contained in:
Patrick Schult 2024-02-14 09:32:17 +01:00 committed by GitHub
commit 861fa7b145
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,9 +39,13 @@ foreach ($containers as $container => $container_info) {
$StartedAt['month'],
$StartedAt['day'],
$StartedAt['year']));
$user_tz = new DateTimeZone(getenv('TZ'));
$date->setTimezone($user_tz);
$started = $date->format('r');
try {
$user_tz = new DateTimeZone(getenv('TZ'));
$date->setTimezone($user_tz);
$started = $date->format('r');
} catch(Exception $e) {
$started = '?';
}
}
else {
$started = '?';