Input the following command in your terminal:
As you see, the Vultr CentOS 6 x64 OS uses the UTC time by default. You can modify it to any time zone as you wish, but using the local timezone of the server’s physical location is a best practice.
If our server was running in China, then we would use the “Asia/Shanghai” time zone:
rm -rf /etc/localtime ln -s /usr/share/zoneinfo/America/Torono /etc/localtime
You can navigate to the directory
/usr/share/zoneinfo to find the appropriate time zone. There is an excellent resource on Wikipedia for timezone listings.
date again, you will find that the local system time has changed to CST (China Standard Time) GMT+0800.
Next, we will write the system time info into the hardware clock.
Modify the content of this file as below.
ZONE="America/Toronto" UTC=false ARC=false
Save and quit.
Write the system time into the hardware clock.
hwclock --systohc --localtime
hwclock to see the result.