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?
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']));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With