Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Change Date and Time Format in WordPress

Have you ever wanted to change the date format in WordPress? Maybe you wanted to abbreviate the month or hide the year or display time? Recently one of our users asked if there was a way to change the date and time format? In this article, we will show you how to change date and time format in WordPress.

Date and Time Settings in WordPress

WordPress comes with built-in functions which allow users as well as developers to format date and time. You can modify your format by going to Settings » General page in WordPress admin area and scroll down to timezone section.

Date and time settings in WordPress

This is where you can choose a timezone for your website along with the date and time formats.

There are couple of built-in options that you can choose from by clicking on the radio button, or you can enter your own custom format.

What are Format Characters for Date and Time in WordPress?

The date and time format are based alphabetic characters that represent a time format. For example, entering Y will output the year in numeric four digits, like 2014.

Entering smaller case y will output the year in numeric two digits, like 14. You can see a full list of format characters here.

Some examples of commonly used date and time format characters:

M d, Y – will output – Nov 06, 2014
d M, Y – will output – 06 Nov, 2014
F jS, Y – will output – November 6th, 2014
l, F jS, Y – will output – Thursday, November 6th, 2014
H:i:s – will output – 21:26:12

You can try different format in the custom box for both date and time settings. After you enter the format, WordPress will show you a preview of what your date or time will look like.

Previewing date and time format

Once you save your settings, it will use this format through out your website unless your theme has pre-defined the format.

Another commonly asked question about date and time formats is how to display time next to dates on your WordPress posts.

The difficult but better solution would be to edit your WordPress theme by creating a child theme and add this line where you want to display the time.

<?php get_the_time(); ?> 

This code will only fetch time for the post or page that is currently being viewed.

However, most beginners don’t want to create child themes and go through the code. For those users, there is an easier way to add the time next to date.

Technically, when WordPress outputs date it actually outputs the complete date and time. However, since most people only use format characters for date, it has no choice but to display only the date. If you entered time related characters in the date format it will display time as well. For example,

d/m/Y g:i a will output 06/11/2014 12:15 pm

Similarly, you can also use date related format characters in the time field if you need.

Depending on your needs, there are many other things you can do with date and time in WordPress. For example, you can show last updated time for posts instead of publish date.

You can also display current date and time and relative dates like ‘This post was published 2 days ago’.

We hope this article helped you learn how to change date and time format in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Google+.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

16 CommentsLeave a Reply

    • You would either set your site’s language to the language you’re wanting or reach out to your theme’s support should it not be translating correctly.


    • You would want to reach out to your theme’s support to see if it could be an error with the theme itself


  1. How do I change the date format for posts? The date format for my theme is for example, October 26th, 2018 but I would like it to be October 26, 2018 without the “th” after the date. The general settings has the date format as what I want but when I look at a page with a blog post it still has the other formatting with the th. Help!

  2. hello, i’ve a problem.i have changed the date format as you demonstrated but when i publish an article, the date format is always in an other form, i am using peflican theme

  3. The current wordpress formatting is different from the one shown here. I can’t seem to even be able to find the timezine in the settings now for wordpress,

  4. I don’t want to see the dates on smart phones, is there a way I can take the dates off all together so my site looks cleaner on the phones? Thanks….

  5. Will it change all my old posts too? Or only new posts going forward? I have wanted to change my format for over a year, but I have so many backlinks out there. I’m afraid it will ruin all my traffic.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.