Need to convert datetime to date during D8 migration from non-drupal source I'm working on a migration where I have

2012-05-07 00:00:00.000000

in my timedate field, but I need to convert it to:

2012-05-07

I realize that I should put this in the prepareRow function, but I'm not sure what it should look like.
public function prepareRow(Row $row) {

   $date = $row-&gt;getSourceProperty('database_date_field');
   $date = strtotime($date); // -&gt; 1336341600 unix timestamp
   $date = date('Y-m-d', $date); // -&gt; "2012-05-07"

   // Here you 'rewrite' the field with the new value before it gets saved
   $row-&gt;setSourceProperty('database_date_field', $date);
   return parent::prepareRow($row);
}