Doubts with dates smaller than 12/31/69 in PHP

1

Galera,

I have a problem transforming database dates to display on screen.

In my code I do the following.

$objReturn['DADOS'][$key]['DATA_NASCIMENTO'] = date('d/m/y', strtotime($value[DATA_NASCIMENTO]));

But what appears on my screen is

Andwhenreturningthevalueasfollows

$objReturn['DADOS'][$key]['DATA_NASCIMENTO']=$value[DATA_NASCIMENTO];

Theresultonscreenisthis

In other words, in the database, the information is saved correctly.

I think my problem is in the way I format this date in PHP.

Does anyone have any suggestions?

    
asked by anonymous 26.06.2017 / 19:42

1 answer

2

Depending on the version of PHP you use, you can do this:

$date = date_create($value[DATA_NASCIMENTO]);
$objReturn['DADOS'][$key]['DATA_NASCIMENTO'] = date_format($date, 'd/m/y');

See if it returns correctly.

    
26.06.2017 / 20:51