Manager/GenericDocumentManager.php
public function normalizeDateToMongo($date)
    {
        if ($date instanceof \DateTime) {
            return new \MongoDate($date->getTimestamp());
        }

        $date = preg_replace('/\.[0-9]+/', '', $date);
        $date = \DateTime::createFromFormat(\DateTime::ISO8601, $date);

        return new \MongoDate($date->getTimestamp());
    }
public function normalizeDateToMongo($date)
    {
        if ($date instanceof \DateTime) {
            return new \MongoDate($date->getTimestamp());
        }

        $date = preg_replace('/\.[0-9]+/', '', $date);
        $date = \DateTime::createFromFormat(\DateTime::ISO8601, $date);

        return new \MongoDate($date->getTimestamp());
    }
@param {DateTime|string|bool} $date

@return {DateTime|bool} Return MongoDate or false for Invalid Dates