Use mysql to insert time into the database, the time saved will automatically +8 hours, which is very uncomfortable.
Solution:
add in the configuration file:
&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
The complete url is:
url:
jdbc:mysql://ip:3306/数据库名?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
Adding the data is normal.
Welcome to leave a comment and learn together!!! Thanks!!!
===========================
Original article, reprinted with the source!