-
Notifications
You must be signed in to change notification settings - Fork 26
Date, Time, Time Zone
Mirro Mutth edited this page Feb 27, 2024
·
7 revisions
These options will affect how the driver uses time zones, and their impact should be the same as mysql-connector-j.
See also https://dev.mysql.com/blog-archive/support-for-date-time-types-in-connector-j-8-0/
They will be affected by preserveInstants and connectionTimeZone.
java.time.ZonedDateTimejava.time.OffsetDateTimejava.time.Instant
They are not affected by time zones.
java.time.LocalDateTimejava.time.LocalDatejava.time.LocalTimejava.time.OffsetTime-
java.time.Duration: duringTIMEfield can be a value between '-838:59:59.000000' to '838:59:59.000000' java.time.Year
- Since 0.8.2, option
serverZoneIdis available- Used to specify the time zone of the connection. If not set, driver will query server time zone on initialization
- Driver receive "zoned" date time and converts its time zone to local:
ZonedDateTime,Instant,OffsetDateTimeandOffsetTime - Driver send "zoned" date times with connection time zone
- All "local" date times (e.g.
LocalDateTime) time zone will not be converted
- Since 1.0.4, change
DATETIME/TIMESTAMPdefault mapping toZonedDateTime - Since 1.1.2, considering various factors and the impact of feedback on version 1.0.4, we finally made adjustments to make behavior as same as possible with JDBC
- Add
preserveInstants,forceConnectionTimeZoneToSession, andconnectionTimeZone - Default
connectionTimeZoneto "LOCAL", which means driver will use JVM local time zone by default -
OffsetTimewill no longer be affected by time zone - Default
DATETIMEtoLocalDateTime,TIMESTAMPtoZonedDateTime- In JDBC,
TIMESTAMPshould bejava.sql.Timestampby default, but we avoid using the old date time type
- In JDBC,
- Add