How7o
  • Home
  • Marketing
    MarketingShow More
    15 Must-See Charts on the State of Marketing
    6 Min Read
    The Beginner’s Guide about Facebook Advertising
    6 Min Read
    64 Creative Marketing Ideas to Boost Your Business
    6 Min Read
  • Resouce
    ResouceShow More
    5 Must-Have Digital Marketing Data Sources
    6 Min Read
    Archival Solution Deployment Best Practices
    6 Min Read
    How Secure Your Mobile Device in Six Steps
    6 Min Read
    5 Effective Ways to Increase Market Share Online
    6 Min Read
    Tips Debugging with CMS code Optimization Quick
    6 Min Read
  • Features
    FeaturesShow More
    7 Things You Need to Know About Feature Driven
    6 Min Read
    Turn an Excel Spreadsheet or Google Sheets Doc
    6 Min Read
    3 Common Ways to Forecast Currency Exchange
    6 Min Read
    Step by Step Guide to a Technical SEO Audit
    6 Min Read
    10+ Free Tools to Make Your Own Animated GIFs
    6 Min Read
  • Guide
    GuideShow More
    Create an Engagement Custom Audience from Video
    6 Min Read
    The Ultimate Guide, Easily Make Videos Tutorials
    6 Min Read
    Tips to Keep Your Cloud Storage Safe and Secure
    6 Min Read
  • Contact
  • Blog
Reading: How to Display Only the Current Date in Laravel (Carbon Examples)
Share
Subscribe Now
How7oHow7o
Font ResizerAa
  • Marketing
  • Resouce
  • Features
  • Guide
  • Complaint
  • Advertise
Search
  • Categories
    • Marketing
    • Resouce
    • Features
    • Guide
    • Lifestyle
    • Wellness
    • Healthy
    • Nutrition
  • More Foxiz
    • Blog Index
    • Complaint
    • Sitemap
    • Advertise
Follow US
Copyright © 2014-2023 Ruby Theme Ltd. All Rights Reserved.
How7o > Blog > Web Development > How to Display Only the Current Date in Laravel (Carbon Examples)
Web Development

How to Display Only the Current Date in Laravel (Carbon Examples)

how7o
By how7o
Last updated: January 12, 2026
4 Min Read
Display only the current date in Laravel using Carbon
SHARE

I ran into a small but annoying issue while building a Laravel page that shows “today’s date” at the top of a report. I used Carbon like I always do:

Contents
  • Method 1 (best/simple): toDateString()
  • Method 2: format(‘Y-m-d’) (best when you need a custom format)
  • Method 3: today() (nice when you truly mean “today”)
  • Showing the date in a Blade view
  • Controller example (recommended style)
  • Timezone tip (this is where people get confused)
  • Quick FAQ
    • Why not just use Carbon::now() and split the string?
    • Which one should I use most of the time?
  • Final thoughts
Carbon::now();

But Carbon returns a full datetime value (date + time). That’s great for logs, but not what I wanted on the UI. I only needed the date, something like 2024-10-11—no hours, minutes, or seconds.

Here are the best ways to display only the current date in Laravel using Carbon, plus the approach I now use depending on where the date is shown (Blade, controller, API, etc.).

Carbon methods to show date only in Laravel (toDateString, format, today)

Method 1 (best/simple): toDateString()

If you want YYYY-MM-DD exactly, this is the cleanest option:

use Carbon\Carbon;

$date = Carbon::now()->toDateString(); // 2024-10-11

I like this because it’s readable and instantly tells you what it returns: just the date portion.

Method 2: format(‘Y-m-d’) (best when you need a custom format)

When I need a different format (like 11-10-2024 or Oct 11, 2024), I use format():

use Carbon\Carbon;

$date = Carbon::now()->format('Y-m-d');   // 2024-10-11
$date2 = Carbon::now()->format('d-m-Y');  // 11-10-2024
$date3 = Carbon::now()->format('M d, Y'); // Oct 11, 2024

If you’re copying a strict format requirement from a client or API docs, format() is usually the right choice.

Method 3: today() (nice when you truly mean “today”)

Sometimes I don’t even want “now” — I want “today” as a date value. Laravel/Carbon gives you that too:

$today = today()->toDateString(); // 2024-10-11

This reads nicely in code and matches the intent: it’s the current date (not a timestamp).

Showing the date in a Blade view

If you just want to display it on the page, Blade can do it directly:

{{ \Carbon\Carbon::now()->toDateString() }}

But on real projects, I prefer passing the value from the controller so the view stays clean.

Controller example (recommended style)

use Carbon\Carbon;

public function index()
{
    $date = Carbon::now()->toDateString();

    return view('reports.index', compact('date'));
}

Then in Blade:

{{ $date }}

Timezone tip (this is where people get confused)

If your server timezone is different than your users, “today” may look wrong near midnight. In that case, set the timezone explicitly:

use Carbon\Carbon;

$date = Carbon::now('Asia/Dhaka')->toDateString();

If this is a full app, it’s usually better to set the correct timezone globally in config/app.php so you don’t have to repeat it everywhere.

Quick FAQ

Why not just use Carbon::now() and split the string?

You can, but it’s fragile and unnecessary. Carbon already provides proper methods that are readable and reliable.

Which one should I use most of the time?

  • Use toDateString() if you want YYYY-MM-DD.
  • Use format() if you need a custom format.
  • Use today() when the intent is “today as a date”.

Final thoughts

Once I switched from Carbon::now() to Carbon::now()->toDateString(), the problem was solved instantly and the code became more readable. If you’re showing dates in a UI, reports, or APIs, picking the right Carbon method saves time and prevents formatting bugs later.

TAGGED:BladeCarbonDate FormattingEloquentLaravelphpTimezone

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Copy Link Print
Previous Article 15 Must-See Charts on the State of Marketing
Next Article Laravel Blade Time Format (HH:MM) How to Show Only Hours and Minutes in Laravel Blade (HH:MM)
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

FacebookLike
XFollow
PinterestPin
InstagramFollow

Subscribe Now

Subscribe to our newsletter to get our newest articles instantly!
Most Popular
How I Fixed Composer Dependency Errors
How I Fixed Composer Dependency Errors Using the –ignore-platform-reqs Flag (Step-by-Step Guide)
January 12, 2026
Transfer Discourse to a new server
How to Transfer Discourse to a New Server on AlmaLinux (Backup + Restore, Step-by-Step)
January 12, 2026
Installed Discourse on AlmaLinux
How I Installed Discourse on AlmaLinux (Docker Method, Step-by-Step)
January 12, 2026
Installing Docker on AlmaLinux guide
Install Docker on AlmaLinux: Step-by-Step (Docker CE + Compose)
January 12, 2026
Change welcome message on Ubuntu VPS server (MOTD + SSH banner)
Change Welcome Message on Ubuntu VPS (MOTD + SSH Banner)
January 12, 2026

You Might Also Like

Laravel Blade Time Format (HH:MM)
Web Development

How to Show Only Hours and Minutes in Laravel Blade (HH:MM)

3 Min Read
Check if GD library is installed in PHP (phpinfo and extension_loaded)
Web Development

How to Check if GD Library Is Installed in PHP (3 Easy Methods)

5 Min Read

Always Stay Up to Date

Subscribe to our newsletter to get our newest articles instantly!
How7o

We provide tips, tricks, and advice for improving websites and doing better search.

Latest News

  • SEO Audit Tool
  • Client ReferralsNew
  • Execution of SEO
  • Reporting Tool

Resouce

  • Google Search Console
  • Google Keyword Planner
  • Google OptimiseHot
  • SEO Spider

Get the Top 10 in Search!

Looking for a trustworthy service to optimize the company website?
Request a Quote
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?