Due to some needs, I rented an overseas server and started my CentOS tour.
Because of the previous use of virtual machines, and at home, so do not need to consider the time zone problem, but now, this server is overseas, so you must consider the time zone problem. What's more, my part of the page code has questions about time contrast, so time zone is more important.
Because I am also a novice, so I searched a lot of things on the internet, so I recorded it.
The following text:
Use the ' tzselect ' command (TimeZone Select)
Enter ' Tzselect ', follow the prompts once to select ' Asia ', ' China ', ' Shanghai ', and finally select ' Yes '.
But at this point, you use date to see that the time has not changed, not what we want. +0800
Then look carefully at the hints he gave you and discover
He should have prompted you to enter ' tz= ' Asia/shanghai ', export TZ '
Ah ~ ~ No way to enter it, and then look again, found this time is right.
became the China Standard Time (CST)
Restart the computer, if you find the time zone back to the time before, then what?
Here's another trick (as for why it's back, I don't know)
Excerpt from Baidu Experience
Modify the configuration file to modify the time zone
1, modify the/etc/sysconfig/clock
PS: But I didn't find the file, so I skipped it.
Zone=asia/shanghai
2, Rm/etc/localtime
3. Link to Shanghai time zone file
Ln-sf/usr/share/zoneinfo/asia/shanghai/etc/localtime
After performing the above procedure, restart the machine to see that the time zone has changed.
CentOS Time zone Settings First understanding