How to print datetime field
1.SQL:
select unix_timestamp(datetimefield) as dtf from table
PHP:
echo date('Y-m-d H:i', $r["dtf"]);
2.SQL:
select * from table
PHP:
$dt = date_create($r["datetimefield"]); echo date_format($dt, 'Y-m-d H:i');
Read manual