scene description
The project deployed on the server uses the time module (such as: scheduled tasks, logs, update time, etc.), at this time, it is found that the time (UTC) on the server is inconsistent with the local time (UTC+8), so how to set the time on the server How about adjusting the time to local time?
solution
Option One
Enter the following command on the server
timedatectl set-timezone Asia/Shanghai
date
You can check the current time zone with the command
- Before changing the time zone
- After changing the time zone
Option II
For Pagoda users, you can download and install the " Linux Toolbox " in the " Software Store " , then open the " Linux Toolbox ", select " Time Zone Settings ", and finally set the time zone to " Asia/Shanghai ".