Title: Date formating
Last modified: June 9, 2021

---

# Date formating

 *  Resolved [damirkg1](https://wordpress.org/support/users/damirkg1/)
 * (@damirkg1)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/date-formating-3/)
 * Hi there,
 * Superb plugin!
 * I have just a little question. Is there any filter I can use to format the date
   of the post in HTML layout to be X hours ago, X days ago, etc. formatting?
 * Thanks.
    -  This topic was modified 4 years, 11 months ago by [damirkg1](https://wordpress.org/support/users/damirkg1/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/date-formating-3/#post-14536967)
 * Hi [@damirkg1](https://wordpress.org/support/users/damirkg1/),
 * > Superb plugin!
 * Thanks, I’m glad you like it!
 * > Is there any filter I can use to format the date of the post in HTML layout
   > to be X hours ago, X days ago, etc. formatting?
 * Actually the plugin provides this out of the box 🙂
 * If you’re using the widget, on the **Stats Tag settings** section under the **
   Display date** option there’s -pardon the redundancy- an option called **Relative**
   that does exactly this.
 * [⌊WPP's relative date format option⌉⌊WPP's relative date format option⌉[
 * If you’re using either the [wpp_get_mostpopular()](https://github.com/cabrerahector/wordpress-popular-posts/wiki/2.-Template-tags#wpp_get_mostpopular)
   template tag or the [[wpp] shortcode](https://github.com/cabrerahector/wordpress-popular-posts/wiki/1.-Using-WPP-on-posts-&-pages)
   then you can use the stats_date_format parameter and set it to ‘relative’, like
   this for example:
 * With wpp_get_mostpopular():
 *     ```
       <?php
       $args = array(
           'stats_date' => 1,
           'stats_date_format' => 'relative'
       );
   
       wpp_get_mostpopular($args);
       ?>
       ```
   
 * With the [wpp] shortcode:
 * `[wpp stats_date=1 stats_date_format='relative']`
    -  This reply was modified 4 years, 11 months ago by [Hector Cabrera](https://wordpress.org/support/users/hcabrera/).
      Reason: Fixed code formatting
    -  This reply was modified 4 years, 11 months ago by [Hector Cabrera](https://wordpress.org/support/users/hcabrera/).
 *  Thread Starter [damirkg1](https://wordpress.org/support/users/damirkg1/)
 * (@damirkg1)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/date-formating-3/#post-14538824)
 * I’m now even more amazined!
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Date formating’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

## Tags

 * [date format](https://wordpress.org/support/topic-tag/date-format/)

 * 2 replies
 * 2 participants
 * Last reply from: [damirkg1](https://wordpress.org/support/users/damirkg1/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/date-formating-3/#post-14538824)
 * Status: resolved