Skip to content

Commit 377272d

Browse files
authored
Merge pull request #1554 from derrabus/bugfix/datetime-on-8.1
Fix deprecation warning on PHP 8.1
2 parents 2209ddd + 2e37d0b commit 377272d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Monolog/Logger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public function addRecord($level, $message, array $context = array())
321321
if ($this->microsecondTimestamps && PHP_VERSION_ID < 70100) {
322322
$ts = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone);
323323
} else {
324-
$ts = new \DateTime(null, static::$timezone);
324+
$ts = new \DateTime('now', static::$timezone);
325325
}
326326
$ts->setTimezone(static::$timezone);
327327

0 commit comments

Comments
 (0)