Have you ever wanted to change the date format on WordPress? Maybe you want to shorten the month or hide the year in your website date?
If this is your case, then do not worry, because in this tutorial I will teach you how to change the date format on WordPress.
But before, if you have never installed WordPress discover How to Install a WordPress Blog in 7 Steps et How to search, install and activate a WordPress theme on your blog
Then back to why we are here.
The date and time in WordPress
By default, WordPress offers a feature that allows users as well as developers to change the date format. It is possible to modify the date format from the " Settings >> General ", On the option" Date Format " and " Time format ».
This is where it is possible to modify the time and date format of your website, either by choosing a predefined format, or by directly modifying the format.
Explanation of the date and time characters in WordPress
The date and time format is based on letters of the alphabet, which represent a fraction of a time or date format. For example, the letter " Y "Reference to the year in digital form, so" 2014 ". For example for "y", "14" will be displayed.
Discover How to display the date of an article update
Here are some concrete examples on the use of time and date formats.
- « M d, Y : Will display Nov 10, 2014
- « D M, Y : Will display 10 Nov, 2014
- « F jS, Y : Will display November 10, 2014
- « l, F jS, Y : Will show Tuesday, November 10, 2014
- « H: i: s : Will display 10: 11: 30
You can try several custom sizes in the " custom "Located at the end of the option" Date Format " and " Time format ».
Once you've added your custom size, save your settings. This format will be used everywhere on your blog, until your WordPress theme decides to use another custom format.
Another question commonly asked about date and time is how to display the time just after dates in WordPress posts.
The most difficult solution, but certainly the best one is to change the theme by creating a " Child Theme And add the following line where you want to display the time.
<? php get_the_time ();?>
This code will retrieve the time for a page or an article.
All the time, most beginners do not want to create a child theme (child theme) and access the source code directly.
See by the way How to display the modification date of an article on WordPress
Technically, when WordPress displays dates, it displays the full date and time format. However, most users use the format that only displays the date, which is why this short format was preferred. If you add the corresponding letters to the time in the date format, well the time will also be displayed.
For example: "D / m / Y g: i": will display 10 / 11 / 2014 11: 15
Also, you can use the date format in the time field to produce the same result.
Discover How to display the date of last connection to a user on WordPress
Depending on your needs, there are several things you can do with the date and time in WordPress. For example, you can display the last modified date of an article, instead of the published date.
Go further with How to remove the dates of comments on WordPress
Discover also some premium WordPress plugins
You can use other WordPress plugins to give a modern appearance and to optimize the handling of your blog or website.
We offer you here some premium WordPress plugins that will help you do that.
1. WordPress Thumby Related Posts Widget
WP Thumby Related Posts plugin can help you improve your WordPress website statistics and especially your visitors' engagement by setting up a landing page that leads them to other relevant and similar content.
You can get more page views for the price of one. Thanks to this plugin, when visitors come to your website, very nice and high quality thumbnails grab their attention to offer them other useful things on the website.
Download | Demo | Web hosting
2. OptinSpin
Recommended Resources
Find out about other recommended resources to help you build and manage your website.
- How to fix mixed content error on WordPress
- How to fix 413 error on WordPress
- How to rename images on a WordPress blog
- What is the difference between H1 and the SEO title of a WordPress article?
Conclusion
Here ! That's it for this little guide on using time and date formats in WordPress. Do not hesitate to share with your friends on your favorite social networks.
However, you will also be able to consult our resources, if you need more elements to carry out your projects of creation of Internet sites, by consulting our guide on the WordPress blog creation.
If you have suggestions or remarks, leave them in our section Comments.
...
How do you put relative dates? For example "This product is published from 2 days.
Hello,
I have succeeded in updating the day and time in French format in the comments, but I cannot translate the "at" which is in the middle: November 24, 2017 at 15:34 pm.
Does anyone have a solution? The wordpress theme used is Islene.
Thank you very much in advance !
Camille
Good evening Cludot,
Look for the .pot file and modify it with software called poedit
Good evening Thierry,
Thanks for your feedback. Unfortunately, I don't have a .pot file on this topic 🙁 nor .po in order to do a translation. I have so far translated everything in the .php files but cannot find this "at" 🙁
Hello Cludot,
Sorry, I can not help you in this case unfortunately.
Dear friends BlogPasCher,
Regarding the date of the articles, I have a question for you.
How do you do the miracle of not having the date displayed next to a result about you after a search in google?
All other sites that date.
Thank you for your reply.
Hello,
The date of the articles will be displayed on search engine results, if this information is part of the microdata that can be used by SEO.
The choice to display this information varies from blog to blog.
On blogPasCher we do not use the date.
Goods.