I am trying to display dates in the European format (dd/mm/yyyy)
with strtotime
but it always returns 01/01/1970.
Here is my codeline :
echo "<p><h6>".date('d/m/Y', strtotime($row['DMT_DATE_DOCUMENT']))."</h6></p>";
In my database, the field is a varchar and records are formated like yyyy.mm.dd
I use the same codeline for another field that is formated like yyyy-mm-dd (varchar too) and it works fine.
Thanks for your help.
Since the format yyyy-mm-dd
works, try to replace .
with -
:
date('d/m/Y', strtotime(str_replace('.', '-', $row['DMT_DATE_DOCUMENT'])));