1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-07-31 02:10:22 +02:00

Fix deprecation warning on PHP 8.1

This commit is contained in:
Alexander M. Turek
2021-05-15 01:18:18 +02:00
parent 2209ddd84e
commit 2e37d0bbd1

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);