mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 13:16:39 +02:00
Only use DateTimeImmutable formatting for default date format, fixes #827
This commit is contained in:
@@ -300,7 +300,9 @@ class NormalizerFormatter implements FormatterInterface
|
|||||||
|
|
||||||
protected function formatDate(\DateTimeInterface $date)
|
protected function formatDate(\DateTimeInterface $date)
|
||||||
{
|
{
|
||||||
if ($date instanceof DateTimeImmutable) {
|
// in case the date format isn't custom then we defer to the custom DateTimeImmutable
|
||||||
|
// formatting logic, which will pick the right format based on whether useMicroseconds is on
|
||||||
|
if ($this->dateFormat === self::SIMPLE_DATE && $date instanceof DateTimeImmutable) {
|
||||||
return (string) $date;
|
return (string) $date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user