Recover Date of type Date - php + mysql

0

Hello, I'm looking for a date information from a database with a lot of information, I'm doing this:

 $data = $tbdeliberacoes->getData();
 date("d/m/Y", strtotime($data));

And this is my return on screen:

 31/12/1969

For all fields it shows this date. But the dates recorded at the bank are normal.

The field I want to fetch is of type Date.

    
asked by anonymous 10.08.2015 / 14:23

1 answer

1

strtotime will only convert the date to timestamp if it is in YYYY-MM-DD format.

If $ data is already in the format d / m / Y, then calling date is unnecessary.

To better understand the conversion between date formats, see this article:

    
12.08.2015 / 14:37