How to Change Date and Time Format in WordPress
Have you ever wanted to change WordPress’s date format? Perhaps you intended to shorten the month, hide the year, or show the time? One of our users recently inquired about changing the date and time format. We’ll show you how to modify the date and time format in WordPress in this article.
In WordPress, you may set the date and time.
WordPress includes the built-in date and time formatting features for both users and developers. Go to the Settings » General tab in the WordPress admin area and scroll down to the timezone section to change your format.
This is where you may set your website’s timezone, as well as the date and time formats.
You can choose from a few pre-built alternatives by clicking the radio button, or you can create your own bespoke format.
What are the Date and Time Format Characters in WordPress?
The date and time format is made up of alphabetic characters that signify time. Entering Y, for example, will produce the year in numeric four digits, such as 2014.
If you type y in lower case, the year will be displayed as a numeric two-digit number, such as 14. A complete list of format characters can be found here.
Here are some examples of date and time format characters that are regularly used:
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
For both date and time settings, you can experiment with other formats in the custom box. WordPress will offer you a sample of what your date or time will look like when you enter the format.
Unless your theme has pre-defined the format, once you save your settings, it will utilize this format throughout your website.
Item display time beside schedules for the WordPress post?
In the event you make a child theme and add this line where you want to display the time, you can edit the theme.
1
|
<?php get_the_time(); ?> |
This code will benefit from getting time used just for our present-day webpage viewed by individuals.
Most starters do not want to learn child themes. There is an easier way to add the time next to the current time.
Once WordPress outputs the date, it actually shows time. Seeing that most people use only format characters for a date, it has no choice but to screen the particular date. If you happen to enter time-related characters with the date format, it displays the time period at the same time. For example.
d/m/Y g:i a
will output 06/11/2014 12:15 pm
If you need, you can utilize day related characters in the time field.
Other things you can do with date and time in WordPress depend on your needs. For example, you can show the last updated time of a post rather than the distribution date.
You can also screen current dates and times and relative dates like ‘This kind of post was published two times ago’.
How do I replace the date and time in WordPress?
Comments are closed.