giovedì 21 giugno 2018

formato data in php da mysql

$result mysql_query("SELECT `datetime` FROM `table`");$row mysql_fetch_row($result);$date date_create($row[0]);

echo 
date_format($date'Y-m-d H:i:s');#output: 2012-03-24 17:45:12
echo date_format($date'd/m/Y H:i:s');#output: 24/03/2012 17:45:12
echo date_format($date'd/m/y');#output: 24/03/12

Nessun commento:

Posta un commento