This commit is contained in:
Laurent Destailleur 2022-06-03 11:10:08 +02:00
parent be729ab5f3
commit 41ce28996c
2 changed files with 2 additions and 2 deletions

View File

@ -2761,7 +2761,7 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = 'auto',
}
//var_dump($localtz);
//var_dump($year.'-'.$month.'-'.$day.'-'.$hour.'-'.$minute);
$dt = new DateTime(null, $localtz);
$dt = new DateTime('now', $localtz);
$dt->setDate((int) $year, (int) $month, (int) $day);
$dt->setTime((int) $hour, (int) $minute, (int) $second);
$date = $dt->getTimestamp(); // should include daylight saving time

View File

@ -173,7 +173,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
$this->lastTime = $now;
}
$message = strftime("%Y-%m-%d %H:%M:%S", time()).$delay." ".sprintf("%-7s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident > 0 ?str_pad('', $this->ident, ' ') : '').$content['message'];
$message = dol_print_date(dol_now('gmt'), 'standard', 'gmt').$delay." ".sprintf("%-7s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident > 0 ?str_pad('', $this->ident, ' ') : '').$content['message'];
fwrite($filefd, $message."\n");
fclose($filefd);
@chmod($logfile, octdec(empty($conf->global->MAIN_UMASK) ? '0664' : $conf->global->MAIN_UMASK));