Beginner’s GuideBlog

How to Change Date and Time Format in WordPress

Have you ever ever wished to vary the date format in WordPress? Perhaps you wished to abbreviate the month or disguise the yr or show time? Not too long ago certainly one of our customers requested if there was a option to change the date and time format? On this article, we’ll present you learn how to change date and time format in WordPress.

Date and Time Settings in WordPress

WordPress comes with built-in features which permit customers in addition to builders to format date and time. You’ll be able to modify your format by going to Settings » Normal web page in WordPress admin space and scroll right down to timezone part.

Date and time settings in WordPress

That is the place you may select a timezone on your web site together with the date and time codecs.

There are couple of built-in choices you could select from by clicking on the radio button, or you may enter your personal customized format.

What are Format Characters for Date and Time in WordPress?

The date and time format are based mostly alphabetic characters that characterize a time format. For instance, coming into Y will output the yr in numeric 4 digits, like 2014.

Getting into smaller case y will output the yr in numeric two digits, like 14. You’ll be able to see a full checklist of format characters here.

Some examples of generally 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 sixth, 2014
l, F jS, Y – will output – Thursday, November sixth, 2014
H:i:s – will output – 21:26:12

You’ll be able to attempt completely different format within the customized field for each date and time settings. After you enter the format, WordPress will present you a preview of what your date or time will appear like.

Previewing date and time format

When you save your settings, it would use this format by out your web site until your theme has pre-defined the format.

One other generally requested query about date and time codecs is learn how to show time subsequent to dates in your WordPress posts.

The troublesome however higher resolution could be to edit your WordPress theme by creating a toddler theme and add this line the place you wish to show the time.

1
<?php get_the_time(); ?>

This code will solely fetch time for the publish or web page that’s presently being seen.

Nonetheless, most saviours don’t wish to create little one themes and undergo the code. For these customers, there may be a better method so as to add the time subsequent to this point.

Technically, when WordPress outputs date it truly outputs the whole date and time. Nonetheless, since most individuals solely use format characters for date, it has no selection however to show solely the date. For those who entered time associated characters within the date format it would show time as nicely. For instance,

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

Equally, you can even use date associated format characters within the time subject in the event you want.

Relying in your wants, there are various different issues you are able to do with date and time in WordPress. For instance, you may present last updated time for posts as a substitute of publish date.

You too can show present date and time and relative dates like ‘This publish was printed 2 days in the past’.

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

Download The WPSaviour App Now

Leave a Reply

Your email address will not be published.

Pay in your preferred currency
Indian rupee
Euro