Source: 5balloons.info

Carbon date String formatting
To format a Carbon date to string output, you can use the format function and pass the following parameter $carbonDate->format('l jS \\of F Y h:i:s A'); //Output -> Thursday 25th of December 1975 02:15:16 PM If you are looking to shorten the day and month in this format you can use $carbonDate->format('D jS \\of M Y h:i:s A'); //Output -> Mon 17th of Oct 2022 06:33:47 AM If you are looking to output the time in 24 hour time instead of AM/PM you can use following $carbonDate->format('D jS \\of M Y H:i:s'); //Output -> Mon 17th of Oct 2022 18:33:47
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners