David Carr
DC Blog

DC Blog

Get the last day of the month from a date

David Carr
·Aug 26, 2021·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

To get the last day of the month use date('t'):

$dueDate = date('t/m/Y', strtotime($row->created_at));

or with Carbon (Laravel example)

$row->created_at->format('t/m/Y');

 

 
Share this