I am trying to convert a date from yyyy-mm-dd to dd-mm-yyyy (but not in SQL); however I don\'t know how the date function requires a timestamp, and
yyyy-mm-dd
dd-mm-yyyy
There are two ways to implement this:
1.
$date = strtotime(date); $new_date = date('d-m-Y', $date);
2.
$cls_date = new DateTime($date); echo $cls_date->format('d-m-Y');