Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sitemap generation not considering local time #157

Open
juankk opened this issue Mar 10, 2020 · 2 comments
Open

Sitemap generation not considering local time #157

juankk opened this issue Mar 10, 2020 · 2 comments

Comments

@juankk
Copy link

juankk commented Mar 10, 2020

Having the site hosted in Sydney +11 hours we are seeing today's sitemap file does not appear in the list of sitemaps unitl 11am Sydney time each day.

The current time in Sydney is 10am and it is still showing yesterday's file (26th February).

investigating the plugins seems that the search on the cronjob is considering utc times.

PR: #158

@t-wright
Copy link

Related ticket: #105741-zd-wordpressvip

@t-wright
Copy link

Adding some extra documentation to this issue:

Issue
Daily sitemaps are created at midnight UTC but posts appear in the daily sitemap which corresponds to their local publish date. For sites in a UTC+ timezone, this causes posts created after midnight local time to be missing from the sitemap until midnight UTC.

What should happen
Posts should probably appear in the daily site map according to their UTC publish date.

Why does this issue occur
The $start_date and $end_date passed to the queries which get the sitemap's posts date_range_has_posts() and get_post_ids_for_date() are in server (UTC) time, while the post_date being queried is in local time according to the timezone setting in wp-admin.

What sites does this impact
This issue impacts sites in a UTC+ timezone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants