Skip to content

Everything for WordPress, web development — and beyond

Date and time format in WordPress with a live preview

Date and time format in WordPress: a builder with a live preview

Build the format with the buttons or type it in by hand — and see straight away how the date will look in Ukrainian, Russian or English. Plus a ready-made string for the settings and a correct PHP call for the theme.

The same codes as in the “Custom” field on the Settings → General page.
The site language, not the browser language.
The switch affects the preview only: on the site WordPress picks the grammatical case itself.

In Ukrainian and Russian a month name has two forms, and wp_date() chooses between them by the shape of the format itself: if the day comes before F (j F, d. F), the genitive is used («10 серпня»); in every other case the nominative is («Серпень 2026»). This is done by wp_maybe_decline_date(); for English it never kicks in at all. That is why «Серпень 10, 2026» is impossible to get: the day–month order is itself the case switch.

Presets
Day and month
Year and time
Separators
Any Latin letter in the format is a code. To output the letter itself, put a backslash before it: \a\t gives «at», while an unescaped at gives «pm31» (a = am/pm, t = days in the month).
Enter a format string or choose a preset.
Updated every second. Month and weekday names come from your browser's Intl.DateTimeFormat — in WordPress they come from the translation file, so the case or the dot in abbreviations may differ.
Reference momentResult
Exactly the dates where a format usually breaks: a single-digit day, midnight in 12-hour notation and the turn of the year.
What you will output the date with in code
Enter a format string.
Paste it into the “Custom” field under the format radio buttons. WordPress shows a live example next to it — it should match the preview above.
CodeWhat does it meanNow
All PHP format codes with their current values; the ones used in your string are highlighted. Those marked depend on the time zone — the browser's here, the server's on the site.

Everything is computed in your browser: the format, the date and the generated code are never sent anywhere.

Why the date in the theme is not translated into the site language

WordPress has three ways to output a date, and two of them are broken. date() is a plain PHP function. It knows nothing about the site locale or its time zone, so the month will always be in English and the time will be the server's. date_i18n() does translate, but it has been deprecated since WordPress 5.3 and has time zone problems. wp_date() is the only correct option: it honours both the locale and the site's time zone. Separately: strftime() was deprecated in PHP 8.1 and removed in PHP 9. Themes that still use it will start throwing warnings, and later fatal errors. One more detail, specific to Ukrainian: in the format “5 січня” the month is in the genitive case, while in the heading “Січень 2026” it is in the nominative. These are different forms and one cannot be substituted for the other. The tool shows both.

Frequently asked questions