Article Title: The UbuntuLinux system uses command lines to modify the time zone. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
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
Then follow the prompts to select the serial number corresponding to Asia. After the selection, a bunch of new prompts will be displayed-enter the city name, such as Shanghai or Chongqing, finally, use sudo date-s "" to modify the local time.
During the operation, it is found that the Ubuntu7.10 Server does not support the tzconfig tool. In this case, you need to use tzselect to modify the time. The usage is similar to that of the tzconfig tool, the prompt information is slightly different from the selected information. (unlike tzconfig, You need to execute this command after setting: sudo cp/usr/share/zoneinfo/Asia/ShangHai/etc/localtime ). Example:
Tzselect
Select the time zone as prompted, and then:
Sudo cp/usr/share/zoneinfo/Asia/ShangHai/etc/localtime
Run
Sudo ntpdate cn.pool.ntp.org
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 ).