CentOS command to change the system time to Beijing Time

Source: Internet
Author: User


The CentOS command to change the system time to Beijing time found that the server was not Beijing time when adding an automatic task today. Now we change it to Beijing time. 1. delete the local time and set the time zone to Shanghai rm-rf/etc/localtimeln-s/usr/share/zoneinfo/Asia/Shanghai/etc/localtime 2. use date to check whether the time is correct. If it is incorrect, continue the following operations. Use ntp to synchronize the time ntpdate stdtime.sinica.edu.tw www.2cto.com 3. if the command not found prompt is displayed, ntp is not installed. Run the following command to install yum-y install ntpdate ntp and then run the second step again. Run the date command to check if it is Beijing time. 4. Set the hardware time to be consistent with the software time and calibrate/sbin/hwclock -- too Oh.
 

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.