[Web] fix blank /debug page with invalid timezone

This commit is contained in:
FreddleSpl0it 2024-02-09 15:08:21 +01:00
parent 3cb9c2ece5
commit a0e55cb9b1
No known key found for this signature in database
GPG Key ID: 00E14E7634F4BEC5

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 = '?';