date('Y-m-d H:i:s', strtotime('2004-08-04T19:09:02.768Z')); alternative js code example
Example: php date strtotime format
$date = '25/05/2010';
$date = str_replace('/', '-', $date);
echo date('Y-m-d', strtotime($date));
$date = '25/05/2010';
$date = str_replace('/', '-', $date);
echo date('Y-m-d', strtotime($date));