my solution to format from yyyy-mm-dd to dd-mm-yyyy:
if the record is empty => show "no data"
<?php if ($row_Services['Datum'] != "") {
$originalDate = $row_Services['Datum'];
$newDate = date("d.m.Y", strtotime($originalDate));
echo $newDate;
} else { echo 'Kein Eintrag'; } ?>
=> "Services" is my recordset
=> "Datum" is my field name
=> "Kein Eintrag" is german and means no data.