0
I need to convert a Datetime to a string, I have the following error:
Catchable fatal error: Object of class Datetime could not be converted to string.
I print in a column of an HTML table like this:
<td align = "center"> <?php echo $linha["data_pagto"]; ?> </td>
I did exactly that there and gave "date_create() expects Parameter 1 to be string, Object Given" and "date_format() expects Parameter 1 to be Datetimeinterface, Boolean Given"
– V.Avancini
Isn’t it because of the single quotes? The same happens with double quotes?
– Hendrig Wernner
found the following solution: <td align = "center"> <?php echo date_format($line["data_pagto"], ’d/m/y');? > </td>
– V.Avancini