How to display RSS feed time and date in local time

You can use the following code snippet to display feed time and date in the local time:

add_filter( 'feedzy_feed_timestamp', 'tifd_change_timestamp', 10, 2 );
/**
 * Change feed timestamp according to the local time.
 *
 * @param int    $timestamp Feed timestamp.
 * @param string $feed Feed Url.
 *
 * @return mixed
 */
function tifd_change_timestamp( $timestamp, $feed ) {
	return $timestamp + get_option( 'gmt_offset' ) * 3600;
}
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us