Title: Date Format in Recent Posts Widget
Last modified: August 30, 2016

---

# Date Format in Recent Posts Widget

 *  [mattbooth](https://wordpress.org/support/users/mattbooth/)
 * (@mattbooth)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/date-format-in-recent-posts-widget/)
 * Hi,
 * The date format in the recent posts widget doesn’t seem to conform to the selection
   made in the WordPress settings. You may want to fix this. In the meantime could
   you please let me know how to fix it. I’m looking in the template-tags.php file,
   and I’m guessing it is something around here…
 * $time_string = sprintf( $time_string,
    esc_attr( get_the_date( ‘c’ ) ), esc_html(
   get_the_date() ), esc_attr( get_the_modified_date( ‘c’ ) ), esc_html( get_the_modified_date()));
 * Thanks
 * Matt

Viewing 1 replies (of 1 total)

 *  [Kimberly](https://wordpress.org/support/users/amiga500/)
 * (@amiga500)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/date-format-in-recent-posts-widget/#post-6791695)
 * if you want you can add filters to the wordpress stack that gets called which
   overrides what this theme is using and you can have it return the default date
   format.
 * However, you can just add the changes to the files you want directly. To get 
   the date format you would use: **get_option(‘date_format’) and get_option( ‘time_format’)**
   and you put it in as the param inside a function such as get_the_date(get_option(‘
   date_format’))
 * I’d, however, recommend you add filters for get_post_time, get_the_date, and 
   get_post_modified_time since all of this theme’s date displays go through them.
   The 2nd parameter is the date format.
 * For example:
 * add_filter(‘get_post_time’,’my_get_post_time’,99,3);
    add_filter(‘get_the_date’,’
   my_get_the_date’,99,3); add_filter(‘get_post_modified_time’,’my_get_post_modified_time’,
   99,3);
 * And now set up your functions and do what you need to do. At least this way when
   the theme updates your changes will remain the same.
 * Alternatively you can create a child theme and modify whatever you like.
 * Btw, template-tags.php isnt the only file with the date thing. Hence why adding
   filters will cover all of them.
 * Kimberly

Viewing 1 replies (of 1 total)

The topic ‘Date Format in Recent Posts Widget’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/wp-fanzone/3.2/screenshot.png)
 * WP FanZone
 * [Support Threads](https://wordpress.org/support/theme/wp-fanzone/)
 * [Active Topics](https://wordpress.org/support/theme/wp-fanzone/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/wp-fanzone/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/wp-fanzone/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Kimberly](https://wordpress.org/support/users/amiga500/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/date-format-in-recent-posts-widget/#post-6791695)
 * Status: not resolved