If the time difference between your Linux server and Beijing time is 8 hours, you can try the following methods to fix it:
-
View the time zone setting of the current Linux server:
timedatectl
Time zone
If not in the outputAsia/Shanghai
, the Linux server's time zone is not set correctly. -
Modify the time zone setting of the Linux server:
sudo timedatectl set-timezone Asia/Shanghai
Set the time zone to Dongba District (Beijing time).
-
Verify that the time zone setting is in effect:
timedatectl
Time zone
If yes in the outputAsia/Shanghai
, it means that the time zone setting has taken effect, and the time of the Linux server should be the same as Beijing time. -
If the time zone is already set correctly, but the time is still incorrect, you can try to set the time manually:
sudo date -s "2022-01-01 00:00:00"
Set the time to the correct time.