How to set the time zone for ubuntu and synchronize time on the Internet

Source: Internet
Author: User
By default, Linux uses the UTC format as the standard time format. if you run a program in Linux and specify a different time zone in the program, a time error may occur. For Ubuntu desktop, you can directly modify the time zone information in graphic mode...
By default, Linux uses the UTC format as the standard time format. if you run a program in Linux and specify a different time zone in the program, a time error may occur. For Ubuntu desktop, you can directly modify the time zone information in graphic mode. but for Server, you need to modify the time zone information through tzconfig. Usage (for example, set the time zone to Asia/Chongqing): sudo tzconfig. if the command does not exist, use dpkg-reconfigure tzdata and select the Asia serial number as prompted, after the selection, a bunch of new prompts will be displayed-enter the city name, such as Shanghai or Chongqing, and then use sudo date-s "" to modify the local time. Select the time zone as Prompted. then, run the following command on www.2cto.com sudo cp/usr/share/zoneinfo/Asia/ShangHai/etc/localtime to prevent the time zone from changing after the system restarts. Online synchronization time 1. install ntpdate tool # sudo apt-get install ntpdate 2. set system time and network time synchronization # ntpdate cn.pool.ntp.org 3. write system time to hardware Time # hwclock-systohc
Cn.pool.ntp.org is a public NTP server located in China. it is used to synchronize your time (if your time is different from the server's time cut, you may not be able to synchronize the time, even commands such as sudo reboot cannot be executed ).

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.