How would I convert the following so that it uses the datetime class?:
array(
'post_date' => date('Y-m-d H:i:s', $date),
'post_date_gmt' => gmdate('Y-m-d H:i:s', $date),
);
Eg this part is easy but how about the gmdate?
$oDate = new DateTime($date);
array(
'post_date' => $oDate->format('Y-m-d H:i:s'),
'post_date_gmt' => gmdate('Y-m-d H:i:s', $date),
);