Get the last day of the month from a date

David Carr

Laravel Framework Tutorials PHP & MySQL

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');

 

Copyright © 2006 - 2024 DC Blog - All rights reserved.