Jump to content

[SOLVED] php date from SQL


Cliftron

Recommended Posts

It really depends on the query,

personally i create an alias

ie

$SQL = "SELECT *, NOW() as theDate FROM table";
$timestamp = $list['theDate'];
echo date("d/m/y",$timestamp)

 

but you can also do this

$SQL = "SELECT *, DATE_FORMAT(now(),'%e/%m/%y') as theDate FROM table";
echo $list['theDate']

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.