I have a 5.1 mySQL server where
SELECT @@global.time_zone, @@session.time_zone, @@system_time_zone;
SYSTEM SYSTEM PDT
A containerized application (in docker) is accessing this database, where the timezone is UTC.
The unix box's timezone where everything runs has timezone set to PDT.
Basically, db set to PDT, application set to UTC, and unix os env set to PDT.
Using spring 4 /Java8 and Connector/J 5.1.40
When I retrieve a timestamp field form the database, the field value does not reflect the real value.
In the app where the timezone is UTC, I get java.sql.TimeStamp value with an offset of 0 (it means UTC), but the time value is the PDT value, so when I try to convert it to a java8 ZOnedDateTime value, it thinks field value is already UTC.
Am I missing some settings for whether the jdbc connection string, or else?
ANy help I will appreciate.
SELECT @@global.time_zone, @@session.time_zone, @@system_time_zone;
SYSTEM SYSTEM PDT
A containerized application (in docker) is accessing this database, where the timezone is UTC.
The unix box's timezone where everything runs has timezone set to PDT.
Basically, db set to PDT, application set to UTC, and unix os env set to PDT.
Using spring 4 /Java8 and Connector/J 5.1.40
When I retrieve a timestamp field form the database, the field value does not reflect the real value.
In the app where the timezone is UTC, I get java.sql.TimeStamp value with an offset of 0 (it means UTC), but the time value is the PDT value, so when I try to convert it to a java8 ZOnedDateTime value, it thinks field value is already UTC.
Am I missing some settings for whether the jdbc connection string, or else?
ANy help I will appreciate.