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

Posts in missed schedule state when host time is not UTC #28

Open
DoobleD opened this issue Apr 13, 2022 · 4 comments
Open

Posts in missed schedule state when host time is not UTC #28

DoobleD opened this issue Apr 13, 2022 · 4 comments

Comments

@DoobleD
Copy link

DoobleD commented Apr 13, 2022

Thank you for this sqlite port!

When the host time is not UTC (for instance Europe/Paris), new posts can't be published. Instead, they're instantly in a missed schedule state.

Changing the WP timezone from Settings > General > Timezone doesn't solve the issue.

@DanielRuf
Copy link

How is that related to this sqlite wrapper in general? Sounds more like a general WordPress issue with the system / PHP timezone.

@DoobleD
Copy link
Author

DoobleD commented Apr 16, 2022

Well the issue didn't arise when I tested with MySQL, and with a PostgreSQL plugin, on the same host.

I thought perhaps it could come from the NOW and/or CURDATE emumations. By default SQLite's date function returns time in UTC, whereas it looks like MySQL and PostgreSQL NOW functions return time in the local timezone (respective docs here, here and here).

Just a guess though, I haven't tested further. I instead changed the host timezone to UTC.

@johnbillion
Copy link

I know it doesn't address your bug report directly, but you shouldn't change the timezone from UTC on a server running WordPress as it can cause time calculations to be doubled up or cancelled out. Info here: https://github.com/johnbillion/wp-crontrol/wiki/PHP-default-timezone-is-not-set-to-UTC

@aaemnnosttv
Copy link
Owner

Looks like NOW and CURDATE are implemented to use PHP's date function so they would indeed be subject to whatever the configured timezone is for PHP. If these should always be UTC, that should be straightforward to correct.

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

4 participants