Convert Unix Timestamp to date?
Posted on 2005-04-04
I am working on a php project and am looking for a way to convert a unix timestamp to a data field with out using php (i already know how to do that).
I need to convert it in the sql query because i have developed a way to display the results of a query automatically in a query... Does mysql have such a feature...
here is my sql querythat i am using!..
$sql = "SELECT invoice.invoicenum as 'Invoice',
invoice.date as 'Date',
invoice.finaltotal as 'Final Total',
invoice.total as 'Total',
CONCAT(customer.firstname,' ',customer.lastname) as 'Customer Name',
CONCAT(vin.year,' ',vin.make,' ',vin.model) as 'Vehical',
customer.address as Address,
customer.plate as Plate,
users.user_name as 'Employee'"
. ' FROM invoice'
. ' LEFT JOIN customer ON invoice.customer_id = customer.customer_id'
. ' LEFT JOIN users ON invoice.user = users.id'
. ' LEFT JOIN vin ON invoice.vin_id = vin.id'
. ' WHERE invoice.activity =\'incomplete\''
. ' ORDER BY `invoice`.`date` DESC ';