Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
The simplest way to show today’s date is the native Date block: open the block inserter, search for “Date” (or type /date), and choose a format. In a theme or plugin, print the current site date with echo esc_html( wp_date( 'F j, Y' ) );.
Display today’s date without code
Use the Date block
- Open the page, post, or Site Editor template where the date should appear.
- Open the block inserter, search for Date, and insert it. You can also type
/dateand press Enter. - In the block settings, disable the default format if necessary, then select the format you want.
This block is best when content editors need to change the placement or presentation without editing PHP.
Print the current date in a theme or plugin
Use wp_date()
For PHP output that follows the WordPress site’s configured timezone, use:
<?php
echo esc_html( wp_date( 'F j, Y' ) );
?>
With no timestamp argument, wp_date() uses the current time. With no timezone argument, it uses the timezone configured for the site. The function returns localized date text and was introduced in WordPress 5.3.0 as the newer replacement for date_i18n(), without that function’s legacy quirks.
#1 Best Overall
Escape the final value with esc_html() when inserting it into page HTML. If a site needs to modify all wp_date() results centrally, WordPress provides the wp_date filter hook.
Choose a date format
wp_date() uses PHP-style date-format characters. Common patterns include:
| Format | Example | Meaning |
|---|---|---|
F j, Y |
September 30, 2026 | Full month, day without a leading zero, and four-digit year |
l, F j, Y |
Wednesday, September 30, 2026 | Full weekday followed by the long date |
Y-m-d |
2026-09-30 | Four-digit year, two-digit month, and two-digit day |
m/d/Y |
09/30/2026 | Numeric month/day/year format |
Fis the full month name.jis the day of the month without a leading zero.Yis the four-digit year.lis the full weekday name.
Escape literal letters with a backslash in the format string so PHP does not interpret them as date tokens. For example, use F j, Y at g:i A when the word “at” should appear as ordinary text.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Make sure the timezone is correct
- Go to Settings > General in WordPress.
- Choose the city or UTC offset that matches the site’s operations and intended local time.
- Save the setting and check the local date and time shown on that screen.
- If the date is business-critical, test the output around midnight and during daylight-saving transitions.
WordPress’s wp_timezone() function returns a DateTimeZone object based on the configured city or UTC offset. A server timezone, browser timezone, or JavaScript timezone that differs from the WordPress setting can otherwise make a date appear to change at an unexpected hour.
Rank #3
Show today’s date with JavaScript in a custom block
The official @wordpress/date package provides date-formatting helpers that use PHP-style format strings with WordPress date values and site timezone settings. Use it when a custom block or editor-side interface must update the date dynamically.
Keep the JavaScript timezone definition consistent with the site’s WordPress timezone. Otherwise, a value close to midnight can switch to the previous or next calendar day in the browser or editor.
Rank #4
Do not use a post date for “today”
Current date
Use the Date block or wp_date() when the label must reflect the current day whenever the page is viewed.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Publication date
Use the Post Date block in a Site Editor template to display when a post or page was published. In PHP, get_the_date() retrieves a post’s date, while the_date() may print only when the current post date differs from the previous one in a loop. These functions describe the post’s publication metadata; they do not produce a continuously changing “today” label.
Best Value
Which method should you use?
| Need | Recommended method | Why |
|---|---|---|
| Editors need a no-code date on a page or template | Date block | Built into the block editor and configurable from block settings |
| A theme or plugin must render the current date | wp_date() |
Uses the site timezone and supports localized PHP date formats |
| A custom block needs dynamic editor-side formatting | @wordpress/date |
Provides WordPress-aware JavaScript date helpers |
| A template must show when content was published | Post Date block or get_the_date() |
Reads the post’s stored publication date instead of the current day |
Frequently Asked Questions
Why is WordPress showing the wrong date?
Check Settings > General and select the correct city or UTC offset. Then test around midnight and daylight-saving changes; a browser or server timezone that differs from the WordPress setting can shift the displayed calendar day.
What is the difference between wp_date() and date_i18n()?
WordPress documents wp_date() as the newer replacement for date_i18n(), without date_i18n()’s legacy quirks. Use wp_date() for new theme and plugin code.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →

