1
0
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:
Jordi Boggiano
2016-07-29 05:07:02 +02:00
parent 6b0d0c4a19
commit 5967b80dfb

View File

@@ -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;
} }