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 gmdate() instead of date() #75

Closed
JJJ opened this issue Nov 28, 2020 · 0 comments · Fixed by #79
Closed

Use gmdate() instead of date() #75

JJJ opened this issue Nov 28, 2020 · 0 comments · Fixed by #79
Assignees
Labels
component-column The Column class component-date The Date query class

Comments

@JJJ
Copy link
Collaborator

JJJ commented Nov 28, 2020

Berlin expects to be working with datetime's in UTC.

WordPress sets the timezone to UTC using date_default_timezone_set( 'UTC' ).

This isn't really a problem, but it could be if date_default_timezone_set() was ever called using anything but UTC.

@JJJ JJJ added component-column The Column class component-date The Date query class labels Nov 28, 2020
@JJJ JJJ self-assigned this Nov 28, 2020
JJJ added a commit that referenced this issue Dec 4, 2020
Berlin enforces storing datetime values according to UTC/GMT. For WordPress, date/gmdate are essentially synonymous, making these functions easy to conflate.

A future version of validate_datetime() may implement its own time zone handler, as a way to internally override/verify the UTC result, but gmdate() here is a small step towards that.

Fixes #75.
@JJJ JJJ closed this as completed in #79 Dec 4, 2020
JJJ added a commit that referenced this issue Dec 4, 2020
* Column: In validate_datetime(), prefer gmdate() over date().
* Queries\Date: Prefer gmdate() over date().

Berlin enforces storing datetime values according to UTC/GMT. For WordPress, date/gmdate are essentially synonymous, making these functions easy to conflate.

A future version of validate_datetime() may implement its own time zone handler, as a way to internally override/verify the UTC result, but gmdate() here is a small step towards that.

This is a merge of upstream changes from WP_Date_Query.

Fixes #75.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-column The Column class component-date The Date query class
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant