Date Data Recovery - php + mysql

Asked

Viewed 641 times

0

Hello, I am searching from the bank a data information in a grid with various information, I am doing so:

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

and this is my return on screen:

 31/12/1969

for all fields it shows that date. But dates saved in the database are normal.

The field I want to search is of the type Date.

  • When you print it $data it comes in what format?

  • the variable $data is printed d/m/Y

  • If $data = $tbdeliberacoes->getData(); already returns in d/m/Y does not need date or strtotime.

  • I don’t quite understand the question. Are you returning all the correct data, only the dates appear repeated? If yes, it is not lacking to increase the iteration with the results, as for example with the use of foreach ?

  • Yes, the field in the database is of type DATE, I search the date in a symfony "json" file. In this I put date(’d/m/Y', strtotime($tbdeliberacoes->getData()), in the action I put: list($dia, $mes, $ano) = explode("/", $request->getParameter($field)); $data = date("Y-m-d", strtotime($year."-".$mes."-".$day)); $arrQuery[] = 'upper(date) LIKE '%'. strtoupper($data) . '%'; If I enable debug mode I get this error: Warning: strtotime() expects Parameter 1 to be string If I disable debug mode all dates appear as: 31/12/1969

1 answer

1

  • What about Beraldo ? Leaked from iMasters ?

  • No. I just stop by once in a while.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.