Want to change the date and time format in WordPress? or you wanted to display time and hide year?, Is there any way to change the date and time format in WordPress?
In this article you can learn how to change Date and Time Format Easily in WordPress.
How to Change Date and Time Format in WordPress
WordPress comes with built-in function of date and time format from where user as well as developer can use it. You can easily modify your format by clicking to, Settings » General page in the WordPress admin area and then scroll to the time zone section.
This is where you can change time zone for your website as well as date and time format also.
There are some built-in options from that you can choose by clicking on the radio button, or you can also go with your own custom format.
What are Format Characters for Date and Time in WordPress?
The date and time format are alphabetic based character that represents a time format. For example: – d will output the Date in numeric two digits with leading zeros, like 0-31.
Entering j will output the Date in numeric two digits without leading zero like 1-31.
Some more examples of mostly used date and time character:
d M, Y – >will output –> 06 Nov, 2015
F jS, Y –> will output – >November 6th, 2015
l, F jS, Y –> will output –> Thursday, November 6th, 2015
M d, Y –> will output –> Nov 06, 2015
H:i:s – >will output –> 21:26:12
You can also try entering different format in the custom box for both date and timing settings then WordPress is going to show a preview of date or time will look like.
Once you have entered and save your settings, it will use this format on your website, unless your website theme has pre-defined format.
Here is another commonly asked question about date and time format is how to display time next to the dates on your WordPress posts.
There is also better solution, is to edit your WordPress theme by creating a child theme and add this line where you want to display the time.
However, this code only fetches time for the page that is currently viewed.
Most beginners don’t like child theme and go through the code, for those user there is another way to add time next to the date.
Technically, when WordPress output dates, its output is complete date and time, some people only use the date format so it has no choice to display only date, if you also entered time related character then it’s going to display time as well for example,
d/m/Y g:i a–will output –06/11/2015 12:15 pm
so it’s on your need, how you are going to use date and time related format character.
I hope this article helped you to learn How to Change Date and Time Format Easily in WordPress.