Are you finding the easiest way to change the date and time format in WordPress site? Although your post automatically shows the pre-built date and time on your website, you still want to configure it and set it in your own format. In order to handle this problem, in today’s blog, we will share with you some useful methods that don’t require any coding knowledge. These methods will help you easily change the date and time format according to your purpose. Now, let’s explore.
How to change the date and time format in WordPress?
Method 1:Choosing pre-set date and time formats in WordPress settings
By default, there is a built-in WordPress customization in WordPress settings for a few various date and time formats. You can choose your favorite date and time from the preset options by following the steps below.
- Go to Settings > General
- Let’s scroll down to the Time Zone section
- Choose a Date format
- Choose a Time format
From there, you are able to set the time zone for your website along with the date and time format.
Then, don’t forget to click “Save changes” to update the new date and time format.
Method 2:WordPress customization for date and time using character formatting
In that case, all pre-set date and time options are suitable for your preference, you still set your own WordPress customization by using the character for date and time formatting.
First of all, you need to know some of the characters to set your own WordPress customization for date and time formatting.
- D – the date of the month in 2 digits, for example, 11 or 01
- M – the month in number, such as 9 for September
- Y – the year in four digits such as 2022
- y – a lower case y is to display the year in 2 digits
- L – the day of the week, such as Tuesday
- F – the month in text such as March
- H – the hour
- i – the minutes
- S – seconds
And there are a lot of other characters, you can visit WordPress support to get more the date and time format examples.
You can try out various types of formats in the Custom box displayed at the bottom of a list of pre-set options.
Once you have done it, immediately you will see a preview of the date and time format shown below.
If you are satisfied with the result, let’s click on the “Save Changes” button. After that, your website will use this custom format unless your theme has pre-defined the format.
How to display time next to dates in your WordPress posts?
Recently many users have asked us that “How to display time next to dates in WordPress posts?”.Honestly, there are several ways to carry out this WordPress customization. We are going to demonstrate some popular ways to handle this task.
Method 1: Edit the child theme
This method is quite complicated in terms of technique. Because you need to create a child theme for your site and then add the following line into your child theme where you want to show the time.
<?php get_the_time(); ?>
However, this code only shows the time for the post or page which is currently being viewed.
If you don’t want to create a child theme and go through the code. You can continue to explore the next method.
Method 2: Add time tags to your date formatting
Luckily, there is a simple method that allows you to display the time next to the date without using code. In fact, once WordPress displays the date in a post, it also shows the time side by side. Nevertheless, you need to add the time tag into the date box, otherwise only the date is displayed.
It is easy to change this by adding time characters next to the date in your custom box. You can refer to the example below.
d/m/Y g:i a
Then it will appear on the screen as 11/01/2022 12:15 pm.
Similarly, you can use plenty of creative ways to carry out WordPress customization to your WordPress site. Even you can also show the last updated time for your post instead of the date you published it.
Moreover, you can show the current date and time in relative terms such as ” the post was published 3 days ago“. We will share these topics in the next blogs.
The bottom lines
Hopefully, through this article, you will find it easy to change the date and time format in WordPress. If you encounter any problems, don’t hesitate to drop a comment below. We will support you as soon as possible.
By the way, you can access our Free WordPress themes to discover a wide array of gorgeous, SEO-friendly, and responsive themes for your website.