5
I have a form in Lade taking the values of the database. In it I have a field date
not required to be filled in. When you enter an empty date the results screen displays the date "01/01/1970"
. How do I change this behavior? I would like it to appear empty when the variable is empty.
<th><a href="{{ URL::to('contas?sort=datapagamento') }}">Data de Pagamento</a></th>
<td>{{ date("d/m/Y", strtotime($conta->datapagamento)) }}</td>
Dates are often represented as the number of seconds since 01/01/1970. Therefore, as you have no date, a zero was obtained somehow and this zero ended up turning 01/01/1970.
– Victor Stafusa