This filter returns the HTML that displays your post date along with your blog posts.
You can use this filter to completely overwrite the HTML given, or even add to it.
For example, if you wanted to add a clock icon before your date, you could do this:
Only Show Updated Date
By default, the HTML for the published date and updated date (if it exists) is added to your site. The updated date is hidden with CSS.
In some cases, you might only want the updated date HTML to display. Then this filter can be used:
add_filter( 'generate_post_date_show_updated_only', '__return_true' );
Add Icon to Date
add_filter( 'generate_post_date_output','tu_add_to_post_date' );
function tu_add_to_post_date( $output ) {
return '<i class="fa fa-clock-o" aria-hidden="true"></i> ' . $output;
}
Remove Link from Date
add_filter( 'generate_post_date_output', function( $output, $time_string ) {
printf( '<span class="posted-on">%s</span> ',
$time_string
);
}, 10, 2 );
As you can see, this filter is very powerful and gives you full control over your post dates.