Modify time zone under Linux (TIMEZONE)

Source: Internet
Author: User

Today, using virtual machines to do experiments, ntpdate countless times, time or wrong. Finally found is the time zone setting is New YORK!!!

Just record the way to modify the time zone.

1. View your system time zone

Method 1:

[Email protected] ~]# Date-rthu, 2016 11:57:27 +0800

Method 2:

[Email protected] ~]# cat/etc/sysconfig/clock zone= "Asia/shanghai"

Here we see that our time zone is in New York.


To modify:

[[email protected] ~]# echo ' zone= "Asia/shanghai" ' >/etc/sysconfig/clock[[email protected] ~]# cat/etc/sysconfig/ Clockzone= "Asia/shanghai

The Linux clock setup file is:/etc/localtime, which is actually a symbolic connection to the file in the/usr/share/zoneinfo directory. Assuming we are in Shanghai, you can set the time zone as long as you run the following command.

[Email protected] ~]# ln-sf/usr/share/zoneinfo/asia/shanghai/etc/localtime[[email protected] ~]# ntpdate s2m.time.edu.cn #这个ntp服务器是北京大学的21 Jul 12:03:13 ntpdate[1883]: Adjust time server 129.6.15.28 offset 0.052517 sec


This article is from the "obsessed" blog, make sure to keep this source http://dragondragon.blog.51cto.com/6170889/1828341

Modify time zone under Linux (TIMEZONE)

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.