This is because Google wants universal time. It will translate this correctly to each news search visitor’s local time, which may not necessarily be your local time zone.
What I need to do if I want it in GMT+5:30. I have checked well known sites. They are having proper timezone. So please suggest me a way to achieve it.
-
This reply was modified 7 years, 2 months ago by
satheeshrajv.
-
This reply was modified 7 years, 2 months ago by
satheeshrajv.
I’m using the below code in feed-sitemap-news.php to achieve my requirement. Is it fine?
$td_article_date_unix = get_the_time(‘U’, $post->ID);
echo date_i18n(DATE_W3C, $td_article_date_unix);
Looking at your news sitemap source, the publication date is still being output with +00:00 as TZD value so it appears to not be working correctly. If the dates/times themselves are in your local time, then Google will convert them incorrectly because it will assume the stamps are in GMT.
You could try using date(DATE_W3C, $td_article_date_unix); because there really is no need for parsing that format but it might be just the same result. It also depends on your PHP version how that constant is defined.
Why do you need it to be in your local timezone? Converted to GMT is just fine for Google. It should not have any problems with that…
By the way, please make sure that your correct timezone is selected on Settings > General if you insist on using local time.