1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-06 05:07:36 +02:00

Fix mongodb formatter

This commit is contained in:
Jordi Boggiano
2016-05-27 14:09:32 +01:00
parent 87ea7b4596
commit bd584e89bc

View File

@@ -102,13 +102,6 @@ class MongoDBFormatter implements FormatterInterface
protected function formatDate(\DateTimeInterface $value, $nestingLevel)
{
$seconds = (int) $value->format('U');
$milliseconds = (int) $value->format('u') / 1000;
if ($seconds < 0) {
return new UTCDateTime($seconds * 1000 - $milliseconds);
} else {
return new UTCDateTime($seconds * 1000 + $milliseconds);
}
return new UTCDateTime((int) ($value->format('U.u') * 1000));
}
}