<p>Closing on <span>{{ $event->endDate->format('d/m/Y') }}</span></p>
Now my current result is Closing on 13/1/2017.
The result I request for is Closing on 12/1/2017.
how to -1 day from it?
<p>Closing on <span>{{ $event->endDate->format('d/m/Y') }}</span></p>
Now my current result is Closing on 13/1/2017.
The result I request for is Closing on 12/1/2017.
how to -1 day from it?
<?php
echo date('d-m-Y',strtotime('-1 day', strtotime(date('13-01-2017'))));
Use strtotime, it support this -1day notation.
or datetime oop way
echo (new DateTime('13-01-2017'))->sub(new DateInterval('P1D'))->format('d-m-Y') ;
In your case,
echo (new DateTime($event->endDate->format('d-m-Y')))->sub(new DateInterval('P1D'))->format('d/m/Y') ;