-1

I need some help with converting the date to dd/mm/YYYY.

I have this code to display my date in a html table from a mysql database

echo "<td>".$zeile['datumFahrt']."</td>";

Can I convert it in this line so the format will be dd/mm/YYYY instead of YYYY/mm/dd?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

4

Sure you can, first you need to convert it to timestamp and then format it:

date("d/m/Y", strtotime($zeile['datumFahrt']))
MoeinPorkamel
  • 701
  • 5
  • 8