Automattic / jetpack

Security, performance, marketing, and design tools β€” Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.58k stars 796 forks source link

News sitemap timestamp doesn't match with site's local timezone. #36217

Closed StefMattana closed 6 months ago

StefMattana commented 6 months ago

Impacted plugin

Jetpack

Quick summary

The news sitemap created by Jetpack reports a publishing time that doesn't match the site's. The news sitemap is set to ICT while it should be on IST.

The issue has been reported in this forum thread.

Steps to reproduce

A clear and concise description of what you expected to happen.

I expected the timestamp to be the same.

What actually happened

There is a discrepancy of ~5 hours. A couple of notes:

Impact

One

Available workarounds?

No but the platform is still usable

Platform (Simple and/or Atomic)

Simple, Self-hosted

Logs or notes

DB green: https://jptools.wordpress.com/debug/?url=%20http%3A%2F%2Ffmsikar.in Forum thread: https://wordpress.org/support/topic/publication-date-time-zone/#post-17477860

liviopv commented 6 months ago

πŸ“Œ REPRODUCTION RESULTS

πŸ“Œ FINDINGS/SCREENSHOTS/VIDEO @StefMattana I published and updated a post on my site and the sitemap showed the correct timestamp I have now switched the timezone of the site to the same as the user in this thread.

Sitemap: https://atlivio.blog/news-sitemap.xml Post: https://atlivio.blog/2024/03/06/jetpack-sitemap-test/

I'm leaving this for now to give the sitemap time to update, but everything points to it being a site-specific issue.

Looking at the site's feed, the pubDate in the feed is the same as the one in the sitemap <pubDate>Wed, 06 Mar 2024 11:03:29 +0000</pubDate>, which indicates it should be just that the sitemap is showing publication date and the frontend is showing Last Edited time.

πŸ“Œ ACTIONS

anomiex commented 6 months ago

I'm finding myself a little confused as to what's supposed to be going on here. From the reproduction instructions,

2024-03-06T11:03:29Z

06, March, 2024 4:33 PM

Assuming the second is India Standard Time (IST), those are the same (with the second dropping the seconds). The "Z" suffix on the first indicates it's in UTC, and 11:03 UTC is indeed 4:33 PM IST.

I'm not seeing where ICT (Indochina Time) comes into it at all. ICT for that time would be 6:03 PM (18:03 in 24-hour format).

The time discrepancy doesn't look perfect (ie an exact 5 hours of difference

Note IST is UTC+5:30.

In machine-readable data it's fairly common to output timestamps in UTC, relying on the client consuming the data to convert it to the appropriate timezone for display to humans. The sitemap code in Jetpack does this, and I see no option for outputting the data using a timezone other than UTC.

StefMattana commented 6 months ago

Hey @anomiex,

The "Z" suffix on the first indicates it's in UTC, and 11:03 UTC is indeed 4:33 PM IST.

TIL 🀯

I'm not seeing where ICT (Indochina Time) comes into it at all. ICT for that time would be 6:03 PM (18:03 in 24-hour format).

This is what I saw in the previous RankMath and Jetpack sitemaps before logging the issue here. I nudged the user to check their timezone settings, they said it was set on IST while I checked that the timezone had ~ hours discrepancy with UTC 🀷

It sounds like we solved the mystery, and then there's nothing actionable from our end. Thanks all!