WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Beginners Guide» How to Change Date and Time Format in WordPress

How to Change Date and Time Format in WordPress

Last updated on April 5th, 2018 by Editorial Staff
43 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
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+.

43 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

16 Comments

Leave a Reply
  1. Krishna says:
    Apr 30, 2020 at 10:20 am

    How to translate date to specific language like hindi?

    Reply
    • WPBeginner Support says:
      May 1, 2020 at 9:39 am

      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.

      Reply
  2. Alex Abir says:
    Jul 23, 2019 at 3:05 pm

    Showing false time on my WordPress theme single page.
    How to Solve?

    Reply
    • WPBeginner Support says:
      Jul 24, 2019 at 9:52 am

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

      Reply
  3. Courtney Stevens says:
    Oct 26, 2018 at 1:40 pm

    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!

    Reply
  4. Danold says:
    Sep 26, 2018 at 10:19 am

    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

    Reply
    • WPBeginner Support says:
      Sep 26, 2018 at 9:08 pm

      Hi,

      Try previewing your site with a default theme. See if that resolves the issue. If it does, then this means your theme is overriding the WordPress date format.

      Reply
  5. MUMBERE AUSBEL says:
    May 21, 2018 at 2:11 am

    You guys are the best.

    Reply
  6. Irfan says:
    Mar 21, 2017 at 7:30 am

    Thank you sooo much it help me alot :)

    Reply
  7. Scott says:
    Jan 25, 2017 at 10:54 am

    Weird! I can not get the to show anything.

    Reply
  8. Gabriele says:
    Apr 14, 2016 at 4:45 am

    Hi, if I would set the WP clock one year advance is it possibile?

    Reply
  9. Matthew Spence says:
    Feb 26, 2016 at 11:27 pm

    How do you fix the date? It is not the day after tomorrow.

    Reply
  10. Alice says:
    Jul 7, 2015 at 12:19 pm

    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,

    Reply
  11. Michelle Stokes Decorator says:
    Dec 3, 2014 at 4:15 am

    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….

    Reply
  12. WPBeginner Staff says:
    Nov 11, 2014 at 11:41 pm

    It will only affect the display of dates on your pages. It will not change your permalinks.

    Reply
  13. Kristine says:
    Nov 10, 2014 at 1:13 pm

    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.

    Reply

Leave a Reply Cancel 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.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
WP Mail SMTP logo
WP Mail SMTP
Fix WordPress email delivery issues. #1 SMTP plugin. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2020 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2020)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2020)
    • SiteGround Reviews from 4196 Users & Our Experts (2020)
    • Bluehost Review from Real Users + Performance Stats (2020)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2020 – Step by Step Guide
Deals & Coupons (view all)
Advanced Coupons
Advanced WooCommerce Coupons
Get 50% off the Advanced Coupons smart coupons plugin for WooCommerce.
WP Mail SMTP Coupon
Get $50 off WP Mail SMTP Pro so you can ensure all your WordPress emails reach the inbox.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).
Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress CDN by MaxCDN | WordPress Security by Sucuri.