How do I display serialized 'REST Export' with date format rather than timestamp? I am using csv_serialization contrib module to add csv encoding to the core Serialization output formats. 

I have a view with a REST export display to allow the download of contact form 'message' entities, and as each contact form might have different fields I must return a (serialized) Entity rather than Fields (with the option to configure each field's display).

The resulting csv download lists created date as a unix timestamp and I need to format it as a human readable time and date, but as far as I can see the 'REST export' does not go through rendering so I cannot preprocess it in the same way I might with a different type of Views display.
Even with the rows being displayed as entities, you can have a hook_views_pre_render(&amp;$views) invocation alter the entity field properties before they are used they are rendered out. 

function MYMODULE_views_pre_render($view) {

  // Only alter my_view_machine_id view, rest_export display
  if ($view-&gt;id() == 'my_view_machine_id' &amp;&amp; 
      $view-&gt;getDisplay()-&gt;definition['id'] == 'rest_export') {
    foreach ($view-&gt;result as $row) {
      if (isset($row-&gt;_entity-&gt;created)) {
        // Alter the entity created property to a readable ISO8601 date
        $row-&gt;_entity-&gt;created-&gt;setValue(date('c', $row-&gt;_entity-&gt;created-&gt;value));
      }
    }
  }
}


There might be a better part of Views rendering pipeline (e.g. REST views export has some templating system) to place this in, but it still renders out the altered serialized property.