Connector 8.0 and LocalDate timestamp issue
Posted by: Ricardo Lima
Date: June 20, 2018 12:50PM

Hi guys,

I'm facing a problem with mysql connector and LocalDate - the new class from Java.time package.

LocalDate has as attributes day, month and year, but once I try to save it in the database, it seems that the connector also takes into consideration the time zone (in the db, it is a date).

For example, I want to save a LocalDate expiration date 2020-05-20, but if I change the local zone on my machine, sometimes it saves 2020-05-19.

By the way, I can't have database and server at the same timezone. It's a global application, and I just want to tell the connector to don't touch the timezone.

Solutions like useLegacyDatetimeCode=false didn't work for me. The only workaround that works is to format from LocalDate to String, and save it to the database. But I'd like to have a more elegant solution (if that exists).

Thanks!!

Ricardo Lima

Options: ReplyQuote


Subject
Written By
Posted
Connector 8.0 and LocalDate timestamp issue
June 20, 2018 12:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.