[Linux Basics] How to change time zone
If your Linux system time zone is not configured correctly, you must manually adjust to the correct local time zone. NTP synchronizes time processing only calculates the offset between local time and UTC time. Therefore, configuring an NTP to synchronize time does not solve the problem that the time zone is incorrect. Therefore, when you use a cloud computing service provider such as Microsoft Azure or other VPS or virtual machine, you need to pay attention to whether it is consistent with the time zone of your country.
date
ls -l /etc/localtime
By selecting your continent, country, and city through the wizard, tzselect will eventually output your time zone value in the Posix TZ format.
Change the time zone
You can add a TZ environment variable for yourself:
export TZ=’America/Pangnirtung’
source ~/.bashrc
sudo rm -f /etc/localtime
sudo ln -s /usr/share/zoneinfo/America/Pangnirtung /etc/localtime
sudo timedatectl set-timezone ‘America/Pangnirtung’