src/Sulu/Component/Rest/Csv/CsvHandler.php
public function prepareData($row)
    {
        if (!$row) {
            return $row;
        }

        if (!is_array($row)) {
            $row = $this->serializer->serialize($row, 'array', SerializationContext::create()->setSerializeNull(true));
        }

        foreach ($row as $key => $value) {
            if ($value instanceof \DateTime) {
                $row[$key] = $value->format(\DateTime::RFC3339);
            } elseif (is_bool($value)) {
                $row[$key] = true === $value ? 1 : 0;
            } elseif (is_array($value) || is_object($value)) {
                $row[$key] = json_encode($value);
            }
        }

        return $row;
    }
public function prepareData($row)
    {
        if (!$row) {
            return $row;
        }

        if (!is_array($row)) {
            $row = $this->serializer->serialize($row, 'array', SerializationContext::create()->setSerializeNull(true));
        }

        foreach ($row as $key => $value) {
            if ($value instanceof \DateTime) {
                $row[$key] = $value->format(\DateTime::RFC3339);
            } elseif (is_bool($value)) {
                $row[$key] = true === $value ? 1 : 0;
            } elseif (is_array($value) || is_object($value)) {
                $row[$key] = json_encode($value);
            }
        }

        return $row;
    }
public function prepareData ( $ row ) { if ( ! $ row ) { return $ row ; } if ( ! is_array ( $ row ) ) { $ row = $ this -> serializer -> serialize ( $ row , 'array' , SerializationContext :: create ( ) -> setSerializeNull ( true ) ) ; } foreach ( $ row as $ key => $ value ) { if ( $ value instanceof \ DateTime ) { $ row [ $ key ] = $ value -> format ( \ DateTime :: RFC3339 ) ; } elseif ( is_bool ( $ value ) ) { $ row [ $ key ] = true === $ value ? 1 : 0 ; } elseif ( is_array ( $ value ) || is_object ( $ value ) ) { $ row [ $ key ] = json_encode ( $ value ) ; } } return $ row ; }
The exporter is not able to write DateTime objects into csv. This method converts them to string.

@param mixed $row

@return array
The exporter is not able to write DateTime objects into csv . This method converts them to string .