-
Notifications
You must be signed in to change notification settings - Fork 435
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
Add support for a serverTimeZone property #605
Conversation
The serverTimeZone property can be passed in the connection string and allows globally setting a time zone, which is used for all date and time conversions where no Calendar is explicitly specified, instead of using the client JVM's time zone. Having this option set explicitly in all clients ensures that they all agree on the time zone to use, independently of what their default time zone is. Forcing serverTimeZone to UTC even also helps if the database contains times in more than one time zone, because UTC has no invalid time ranges, so no information is lost converting between a time with unspecified time zone and a time stamp in UTC. Some other JDBC drivers (e.g., MySQL Connector/J and MariaDB Connector/J) also have such an option.
Codecov Report
@@ Coverage Diff @@
## dev #605 +/- ##
============================================
- Coverage 48.79% 48.67% -0.12%
+ Complexity 2824 2811 -13
============================================
Files 118 118
Lines 27877 27878 +1
Branches 4642 4643 +1
============================================
- Hits 13602 13570 -32
- Misses 12086 12116 +30
- Partials 2189 2192 +3
Continue to review full report at Codecov.
|
For the CLA, I am waiting for the official OK from my employer. |
CLA now on file, my employer OKed it. |
@cheenamalhotra - Related to #749 ...? |
Hi @kkofler, The methods that let you specify |
Unfortunately, always explicitly specifying the |
Looks like Hibernate 5.3 has a property called |
Closing the PR as the driver already provides the requested functionality with |
@ulvii i think the solution of use property hibernate.jdbc.time_zone is valid only if use Hibernate In case you don't use hibernate or you can't modify hibernate configuration per single database (i.e third-party application "Appian" ) and you can't manage this scenario I think pull #749 is not related to this feature serverTimeZone Hope reconsider to add support for a serverTimeZone property |
The serverTimeZone property can be passed in the connection string and
allows globally setting a time zone, which is used for all date and time
conversions where no Calendar is explicitly specified, instead of using
the client JVM's time zone. Having this option set explicitly in all
clients ensures that they all agree on the time zone to use,
independently of what their default time zone is.
Forcing serverTimeZone to UTC even also helps if the database contains
times in more than one time zone, because UTC has no invalid time
ranges, so no information is lost converting between a time with
unspecified time zone and a time stamp in UTC.
Some other JDBC drivers (e.g., MySQL Connector/J and MariaDB
Connector/J) also have such an option.