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

Use UTC internally #1451

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Use UTC internally #1451

wants to merge 5 commits into from

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Jul 24, 2023

According to https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html

MySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. (This does not occur for other types such as DATETIME.)

That is bad.

  • Check that we do not use TIMESTAMP anywhere or set MySQL timezone to UTC. The latter might not be possible, as MySQL requires importing data to support named timezones, which is not possible for some hosts.
  • Verify that storing date with offset into MySQL will always store it as UTC, no matter the MySQL timezone.
  • Verify that PostgreSQL includes timezone offsets when selecting datetime values with timezone.
  • Check that MySQL correctly compares datetimes in db with values containing tz offset as produced by daos\mysql\statements::datetime().
  • Add migrations for sqlite local → UTC when date.timezone is not UTC.
  • Add news.md entry.
  • Fix Add support for DateTimeInterface mibe/FeedWriter#50

@netlify
Copy link

netlify bot commented Jul 24, 2023

Deploy Preview for selfoss canceled.

Name Link
🔨 Latest commit d30b23a
🔍 Latest deploy log https://app.netlify.com/sites/selfoss/deploys/64c1b173a856a500085e421e

Ensure DateTime cannot be accidentally mutated when passed as an argument.
According to https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html

> MySQL converts `TIMESTAMP` values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. (This does not occur for other types such as `DATETIME`.)

That is bad.

- [ ] Check that we do not use TIMESTAMP anywhere or set MySQL timezone to UTC.
- [ ] Verify that PostgreSQL includes timezone offsets when selecting datetime values with timezone.
- [ ] Check that MySQL correctly compares datetimes in db with values containing tz offset as produced by `daos\mysql\statements::datetime()`.
- [ ] Add migrations for sqlite local → UTC when `date.timezone` is not UTC.
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

Successfully merging this pull request may close these issues.

1 participant