How to Change the Date Format in WordPress

Need to change the date format used on your site?

WordPress has a simple option for this built into the dashboard, so you don’t need to install any new plugins. In this post, you’ll learn how to change the format, and create your own custom date formats.

How to Change the Date Format

To change the format, visit the General Settings page in your dashboard. There you’ll see the Date Format setting.

the date format setting

There are a few existing formats you can choose from. Select a new format, and save your changes to update the date format across your site.

If you don’t see a format you want to use, you can create your own.

How to Create a Custom Date Format

The first step is to visit the date & time formatting documentation on wordpress.org. There you’ll find a table outlining the characters you can use to create your own format.

For instance, lets imagine a site that publishes once a month. Since there’s only one post per month, there’s no need to display the exact day it was published. This means you could use a format like April 2016.

To do this, you would find the month name character in the WordPress documentation (F), and follow it with a space and the character for the year (Y).

Once you know the characters, enter them into the Custom format box and save your new settings.

entering a custom date format

The dates will update instantly across your site.

How to Add a Timestamp

Most WordPress users don’t realize they can use timestamp characters in their date format. Take these date formats, for example:

April 2, 2016  F j, Y

8:23 am  g:i a

The first one is an example of a date format, and the second is a timestamp.

You can combine these characters to create a date format that includes a timestamp like this:

April 2, 2016, 8:23 am  F j, Y, g:i a

Using the characters, F j, Y, g:i a, the dates across the site can be updated to display both the date and timestamp of publication.

While each of these formats are supported by all our themes, some themes may not support the use of dates and timestamps in conjunction or update the post dates across the site.

Conclusion

Changing the date format used across your site is simple with WordPress.

If one of the pre-existing formats fits your needs well, you can quickly select it and be on your way. Creating your own date formats adds a lot more flexibility for customizing how dates are displayed on your site.

Related Posts

Be First to Comment

    Post a comment

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