1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-03 11:47:38 +02:00

Merge pull request #1554 from derrabus/bugfix/datetime-on-8.1

Fix deprecation warning on PHP 8.1
This commit is contained in:
Jordi Boggiano
2021-05-28 09:28:55 +02:00
committed by GitHub

View File

@@ -321,7 +321,7 @@ class Logger implements LoggerInterface, ResettableInterface
if ($this->microsecondTimestamps && PHP_VERSION_ID < 70100) {
$ts = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone);
} else {
$ts = new \DateTime(null, static::$timezone);
$ts = new \DateTime('now', static::$timezone);
}
$ts->setTimezone(static::$timezone);