Add support for interrogating /etc/timezone.

This commit is contained in:
Greyscale 2020-05-14 22:11:54 +02:00
parent 4b891e1a45
commit 44ba14dc7d

View file

@ -359,6 +359,8 @@ class ⌬
$environmentService = $this->getContainer()->get(Services\EnvironmentService::class);
if ($environmentService->isSet('TIMEZONE')) {
date_default_timezone_set($environmentService->get('TIMEZONE'));
} elseif (file_exists("/etc/timezone")) {
date_default_timezone_set(trim(file_get_contents("/etc/timezone")));
} else {
date_default_timezone_set(self::DEFAULT_TIMEZONE);
}