Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql timestamp conversion/formatting Notice: A non well formed numeric value encountered

In my database I have set row "posted" as a timestamp but I get this notice when trying to convert/format it:

Notice: A non well formed numeric value encountered

code:

$posted = date('d/m/Y H:i:s', $row['posted']);
    echo $posted;

what am I doing wrong?

like image 340
Anna Riekic Avatar asked Jul 24 '12 01:07

Anna Riekic


1 Answers

This means that the second parameter for date() is expecting integer, so convert $row['posted'] to timestamp first.

Try

$posted = date('d/m/Y H:i:s', strtotime($row['posted']));
like image 64
uzyn Avatar answered Oct 23 '22 15:10

uzyn