How to Change Date and Time Format in WordPress

change date and time

Have you ever wondered to change the default date and time format in WordPress site of yours? Maybe you wanted to hide a year or month in the display time. Well, if you want to change date and time format in WordPress, then this post is just for you. 

Here, I have shown you the procedure to change date and time format in WordPress. Just follow the procedure till the very last then you will be able to change date and time format by yourself.

Let’s begin, then.  

What are Format Characters for Date and Time in WordPress?

Change Date And Time Format in WordPress

WordPress comes with a built-in function for adjusting date and time according to your needs. To modify or change date and time, navigate to the Settings -> General page in the admin area of your dashboard. 

Scroll down a little bit, and you will find the option to change the date and time format. The date and time format are entirely based on alphabetic characters which represent date and time format. There are a few time and date formats given in WordPress. You can choose any given format or use a custom format

To use custom formatting, you have to use alphabetic characters. Write characters according to the format mentioned below, then the date and time will be shown in that way. 

Here’s a table of format characters by which you will be able to create your own custom structure.

Full Date/Time

c

ISO 8601

2004-02-12T15:19:21+00:00

I

Thu, 21 Dec 2000 16:01:07 +0200

U

Unix timestamp (seconds since Unix Epoch)

1455880176

Year

Y


Numeric, 4 digits

E.g., 1999, 2003

y


Numeric, 2 digits

E.g., 99, 03

Month

m

Numeric, with leading zeros

01-12

n

Numeric, without leading zeros

1-12

F

Textual full

January – December

M

Textual three letters

Jan – Dec

Weekday

l

Full name  (lowercase ‘L’)

Sunday – Saturday

D

Three letter name

Mon – Sun

Day of Month

d

Numeric, with leading zeros

01–31

j

Numeric, without leading zeros

1–31

S

The English suffix for the day of the month

st, nd or th in the 1st, 2nd or 15th.

Time

a

Lowercase

am, pm

A

Uppercase

AM, PM

g

Hour, 12-hour, without leading zeros


1–12

h

Hour, 12-hour, with leading zeros


01–12

G

Hour, 24-hour, without leading zeros

0-23

H

Hour, 24-hour, with leading zeros

00-23

i

Minutes, with leading zeros

00-59

s

Seconds, with leading zeros

00-59

T

Timezone abbreviation

Eg., EST, MDT …

By using the characters above, you can create your own time format.

Some examples of common date and time format characters are:

  • F j, Y g:i a – November 6, 2022 12:50 am
  • F j, Y – November 6, 2022
  • F, Y – November, 2022
  • g:i a – 12:50 am
  • g:i:s a – 12:50:48 am
  • l, F jS, Y – Saturday, November 6th, 2022
  • M j, Y @ G:i – Nov 6, 2022 @ 0:50
  • Y/m/d \a\t g:i A – 2022/11/06 at 12:50 AM
  • Y/m/d \a\t g:ia – 2022/11/06 at 12:50am
  • Y/m/d g:i:s A – 2022/11/06 12:50:48 AM
  • Y/m/d – 2022/11/06

When you write “Y/m/d,” your date will be shown as 2022/12/17.

You can check the total formatting of the date and time from here.

Final Words

You can use any of the above formats; try now and apply the format that suits your WordPress website best. If you have any questions feel free to ask me, I will be happy to provide answers to your questions. If you liked this post, please share this post with your friends, and don’t forget to share your thoughts in the comment box below. 

Changelog
  • Updated on 2024-12-02 (Uzzal Raz Bongshi)
    • Added table.
    • Updated images.
    • Changed post details.

Leave a Reply

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

New Year Sale - Get 50% OFF on all plans!

X