Time format: 09:58:46.0000000
, datetype: time,
Date format: 2014-05-28
, datetype : date
When I try to print results:
echo "<td>" .date_format( $row['time'], 'H:i:s') . "<hr>";"</td>";
echo "<td>" .date_format( $row['date'], 'dd/mm/YY') . "<hr>";"</td>"
The script returns time in format 10:02:16
(that is good)
But date is in the format 2828/0505/20142014
. Why?
The proper way is
echo "<td>" .date_format( $row['date'], 'd/m/Y') . "<hr>";"</td>"
You were attempting to use d
,m
,Y
twice , that's the reason for weird output
You could try reading http://php.net/manual/en/function.date.php
for more information regarding date formatting
You must pass proper formatting string for PHP
function date_format
.
echo "<td>" .date_format( $row['date'], 'd/m/Y')
Check documentation for more information.
Change this to
date_format( $row['date'], 'dd/mm/YY');
this
date_format( $row['date'], 'd/m/Y');
Use this
echo "<td>" .date_format( $row['date'], 'd/m/Y') . "<hr>";"</td>"
Check documentation for more information.