display-posts-shortcode icon indicating copy to clipboard operation
display-posts-shortcode copied to clipboard

date_format="relative" is relative to UTC not site current time.

Open shazahm1 opened this issue 6 years ago • 1 comments

Line 824 which is currently:

return human_time_diff( $date ) . ' ' . __( 'ago', 'display-posts' );

needs to be:

return human_time_diff( $date, current_time( 'timestamp' ) ) . ' ' . __( 'ago', 'display-posts' );

Otherwise the relative time returned is against the server time() usually set to UTC so the displayed relative time is not correct.

It should be relative against the current time for the site which if offset to the timezone set by the user in there settings.

I hope I have explained this clearly!

shazahm1 avatar Dec 31 '19 14:12 shazahm1