Change date format Codeigniter 3 query builder

1
$this->db->select("DATE_FORMAT(cliente.fecha_reserva, '%M %e, %Y') as formatted_date", FALSE);

This code gives me the following format: June 14, 2017

How do I get the format dd / mm / yyyy?

Thanks

    
asked by Javier Antonio Aguayo Aguilar 20.06.2017 в 16:29
source

1 answer

2

Basic functions of DATE_FORMAT

SELECT DATE_FORMAT("2017-06-15", "%d/%m/%Y");

Copy the code above and paste it here:

link

In your case it would be this:

$this->db->select("DATE_FORMAT(cliente.fecha_reserva, '%d/%m/%Y') as formatted_date", FALSE);
    
answered by 20.06.2017 / 16:34
source