Time in Mysql and PHP [duplicate]

2

Next people with a current_date no MySQL and return the registration date only in the format of the bank: 2017-01-06 .

How do I leave in the format: Friday, January 6, 2017 .

To display my data in the database I use

<?php echo $row->data; ?>

Show her in Portuguese I did more with her echo strftime ("% A,% d of% B of% Y", strtotime ($ date)); He returns all dates to me on December 31, 1969. If I put echo strftime ("% A,% d of% Y of% Y", strtotime ('today')); All stay with the present day.

    
asked by anonymous 06.01.2017 / 20:30

1 answer

1

Try this:

setlocale(LC_TIME, 'portuguese');
date_default_timezone_set('America/Sao_Paulo');

$date = $row->data;
echo strftime("%A, %d de %B de %Y", strtotime($date));
    
06.01.2017 / 20:43