PHP 日付の扱い

$format = ‘Y年m月d日’;
$date = DateTime::createFromFormat($format, substr($str[‘date’],0,17) );
echo $date->format(‘Y-m-d’);