mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-07 13:46:38 +02:00
Fix mongodb formatter
This commit is contained in:
@@ -102,13 +102,6 @@ class MongoDBFormatter implements FormatterInterface
|
|||||||
|
|
||||||
protected function formatDate(\DateTimeInterface $value, $nestingLevel)
|
protected function formatDate(\DateTimeInterface $value, $nestingLevel)
|
||||||
{
|
{
|
||||||
$seconds = (int) $value->format('U');
|
return new UTCDateTime((int) ($value->format('U.u') * 1000));
|
||||||
$milliseconds = (int) $value->format('u') / 1000;
|
|
||||||
|
|
||||||
if ($seconds < 0) {
|
|
||||||
return new UTCDateTime($seconds * 1000 - $milliseconds);
|
|
||||||
} else {
|
|
||||||
return new UTCDateTime($seconds * 1000 + $milliseconds);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user