Skip to content

Conversation

@trevorr
Copy link
Contributor

@trevorr trevorr commented Aug 11, 2019

Support for the timezone connection option as specified by mysqljs/mysql:

timezone: The timezone configured on the MySQL server. This is used to type cast server date/time values to JavaScript Date object and vice versa. This can be 'local', 'Z', or an offset in the form +HH:MM or -HH:MM. (Default: 'local')

Inspired by #732 but with tests and against current master. Removes the need to run tests with process.env.TZ = 'UTC'. It doesn't set the session time_zone variable, but the user should do that if the server time zone is not the same as the requested time zone. However, since time_zone only applies to timestamp columns and date functions — and not stored datetime values — the client and server really need to agree on the time zone in advance anyway.

Fixes #15, #262, #642, #877, #888, and maybe others.

@sidorares sidorares merged commit 769c002 into sidorares:master Aug 12, 2019
@sidorares
Copy link
Owner

Great work @trevorr !

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.

Use timezone from connection options

2 participants