CentOS Time zone Settings First understanding

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.