How format date Carbon:now() in Laravel PHP
Stefan Bogdanescu
Founder & Senior Architect · 2026-06-29
Date formatting is an essential skill for any developer working with web applications or dealing with time-sensitive data. In the context of Laravel, this task can be easily accomplished using Carbon, a powerful PHP library that simplifies date and time manipulation. Here, we'll explore how to format the current date using Carbon::now() within your Laravel application.
Understanding Carbon in Laravel
Carbon is a useful tool for working with dates and times. It comes preinstalled in any Laravel installation, allowing you to manipulate date values as objects or strings. The Carbon::now() method retrieves the current timestamp, which can then be formatted according to your specific requirements.Formatting Date using Carbon::now()
To format the current date and time using the provided example code, you would modify it as follows:sql
update(['access' => Carbon::now()->format('Y/m/d H:i:s')]);Common Date Formats and Best Practices
When working with dates, it is essential to utilize consistent formats throughout your application. This ensures that all data remains understandable and readable for users, as well as other developers working on the project. Here are some useful formatting options for Carbon::now(): 1. ISO 8601 format (Y-m-d\TH:i:sP): The most common international date standard used in various domains.php
$date = Carbon::now()->format('c');php
$date = Carbon::now()->format('l, d F Y H:i:s T');php
$date = Carbon::now()->format('r');php
$timestamp = Carbon::now()->timestamps();php
$date = Carbon::now()->formatLocalized('%A %d %B %Y');