Deployed on the cloud server, the default current time of MySQL is 8 hours less than the current actual time, but the local data data is normal, so the time zone of mysql that may be located in docker is wrong
MySQL database
Field: create_time Type: timestamp Default: CURRENT_TIMESTAMP
Corresponding entity class
private LocalDateTime createTime;
1. View process/container:
docker ps
2. Enter the MySQL container:
docker exec -it f4a2d6bf1063 /bin/bash
3. Enter the command:
date
Check the time, you will find that it is 8 hours less than the current time