Have you ever wanted to change the date format in WordPress? Maybe you want to abbreviate the months or hide the year or time display? In this article, I will show you how to change the date and time format in WordPress.
Date and Time Settings in WordPress
WordPress comes with built-in functions that allow users as well as developers to format the date and time. You can modify your date and time format on the menu Settings »General in the WordPress admin area and scroll down to the timezone section.
Date and time settings in WordPress
This is where you can select the timezone for your website along with the date and time formats.
There are several built-in options that you can choose from with the click of a radio button, or you can enter your own custom format.
What is the Character Format for Date and Time in WordPress?
Date and time formats are based on alphabetical characters representing the time format. For example, the letter Y will display the year with four digit numbers, such as 2014.
Meanwhile, a lowercase y will display the year in two digits, such as 14. You can see the complete list character format right here.
Some examples of the characters commonly used for date and time formats:
M d, Y – will display – Nov 6, 2014
d M, Y – will display – Nov 6, 2014
F jS, Y – will show – November 6th, 2014
l, F jS, Y – will display – Thursday, November 6th, 2014
H: i: s – will display – 21:26:12
You can try different formats in the custom box for both date and time settings. After you enter the format, WordPress will display a preview of the date or time you have set, for example it will look like this.
After you save your settings, your site will automatically use this format unless your theme has a predefined format.
Hopefully the above article helped you in setting the date and time format to your liking. 🙂