Display future post date as X days, Y hours, Z minutes to go

Question

I have a plugin that can display future posts

And I have a function that converts all dates to human_time_diff

// Relative date & time
function wpse_relative_date() {
  return human_time_diff( get_the_time('U'), current_time( 'timestamp' ) ) . ' to ago';
}
add_filter( 'get_the_date', 'wpse_relative_date' ); // for posts and pages
// add_filter( 'get_comment_date', 'wpse_relative_date' ); // for comments

I’d like it to display X days, Y hours, Z minutes to go, rather than just x days to go.

0
Pete 2 months 0 Answers 14 views 0

Leave an answer