Serena Serena - 18 days ago 4x
PHP Question

Need to change my date format

How can I change the format of my date from 2016-10-05 to 10/05/2016 in php

$date= $row['date'];

So when the row echos out it'll all be the new format


Use DateTime to create an object (from the current format), allowing you to reformat the output.

$date = "2016-10-05";
$date = DateTime::createFromFormat('Y-d-m', $date);
echo $date->format('d/m/Y');