What is the relative date? The relative date is a timestamp for your post that displays when a post has been posted. WordPress helps you keep track of all the posts that you posted online on your blog or site using Display relative dates. If you are not aware of how to place a timestamp on your WordPress post then this article gives you a clear idea of how to place and display relative dates in WordPress.
2 Ways to Add Display Relative Dates
- Using Plugin
- Using Code
Add Relative Dates in WordPress using Plugin From your WordPress dashboard, choose Plugins.  Click on Add New.  Search and install the Meks Time Ago plugin from WordPress.  Once installed, activate the plugin by clicking on Activate.  Get back to settings and choose Dashboard.  Scroll down to Meks Time Ago Options.  Now you can set relative dates on your WordPress post.
Once the plugin is added, you can set the following
- Apply “time ago” format to – Here you can check either the Time/Date box or even both to display on your post.
- Apply to posts not older than – The option allows you to apply this only for the post you have chosen.
- Place “ago” word – This allows you to set the timing for the ‘ago’ word to your post. Also, you can change the word Ago to anything like Since, From, Gone by, etc.
Also read how to Add / Embed Google Calendar in WordPress
Set Relative Dates using Code Go to the Plugin dashboard and Add a new plugin named WP-RelativeDate.  Activate the Plugin and go to the Admin panel.  Choose Appearance and Editor from the left panel.  Now you need to find the Code that looks like this
- <?php the_date(); ?>
- <?php get_the_time(); ?>
- <?php get_the_date(); ?>
Most probably it is found inside the following files in the template section: content.php, comments.php, content-page.php, or content-single.php. Once the code is identified, replace them with <?php relative_post_the_date(); ?>.  This will display the relative date on your WordPress.
See how to Add Pagination on a WordPress Site (Text and Numeric)
Using the code might be a time-consuming one and we prefer you use this method and save your time on adding the relative dates. Also, not adding a plugin could help your site be light and fast. Or if you are a newbie, you can definitely go with the plugin and there is nothing to worry about it. Do leave your experience in the comments section below. For more WordPress guides and articles, visit our blog.