Merge branch 'mcguirepr89:main' into main

This commit is contained in:
croisez
2023-05-12 16:03:30 +02:00
committed by GitHub
4 changed files with 66 additions and 47 deletions
+2 -2
View File
@@ -7,14 +7,14 @@ if (file_exists('/etc/timezone')) {
$sys_timezone = trim($tz_data);
}
} else {
// Else get timezone from the timedatectl command
// else get timezone from the timedatectl command
$tz_data = shell_exec('timedatectl show');
$tz_data_array = parse_ini_string($tz_data);
if (is_array($tz_data_array) && array_key_exists('Timezone', $tz_data_array)) {
$sys_timezone = $tz_data_array['Timezone'];
}
}
//Finally if we have a valod timezone, set it as the one PHP uses
// finally if we have a valod timezone, set it as the one PHP uses
if ($sys_timezone !== "") {
date_default_timezone_set($sys_timezone);
}