src/Repository/DoctrineMongoODM/Types/TimezoneAwareDate.php
public function convertToPhpValue($value)
    {
        if (!is_array($value)
            || !isset($value['date'])
            || !$value['date'] instanceof \MongoDate
            || !isset($value['tz'])
        ) {
            return null;
        }
        
        $timestamp = $value['date']->sec;
        $date = new \DateTime('@'.$timestamp);
        $date->setTimezone(new \DateTimeZone($value['tz']));
        return $date;
    }
public function convertToPhpValue($value)
    {
        if (!is_array($value)
            || !isset($value['date'])
            || !$value['date'] instanceof \MongoDate
            || !isset($value['tz'])
        ) {
            return null;
        }
        
        $timestamp = $value['date']->sec;
        $date = new \DateTime('@'.$timestamp);
        $date->setTimezone(new \DateTimeZone($value['tz']));
        return $date;
    }
Converts a TimezoneAwareDate array to a \DateTime Object.

Returns <i>NULL</i>, if <code>$value</code> is an unknown format.

@param array $value
@return NULL|\DateTime