Modify Linux time zone

Source: Internet
Author: User
Modify Linux time zone
1. view the current time zone
# Vi/etc/sysconfig/clock
Linux system time modification
2. Modify the time zone
Method (1)
# Tzselect
Method (2 Limited to RedHat Linux and centos)
# Timeconfig
3. Copy the corresponding time zone file to replace the default time zone of the system.
# Cp/usr/share/zoneinfo/$ main Time Zone/$ Time Zone/etc/localtime
For Chinese servers, run:
# Cp/usr/share/zoneinfo/Asia/Shanghai/etc/localtime
4. Write the current time into the BIOS for permanent effect (to prevent failure after restart)
# Hwclock

How to modify the system time in Linux or Unix
We generally use the "date-s" command to modify the system time. For example, the command to set the system time to June 10, 1996 is as follows.
# Data-s 06/10/96
The command to set the system time to 01:12:00 P.M. is as follows.
# Date-s 13:12:00

---- Note: this is about the system time, which is maintained by the operating system in Linux.
---- When the system is started, the Linux operating system reads the time from CMOS to the system time variable. Later, the modification time is implemented by modifying the system time. To maintain the consistency between the system time and the CMOS time, Linux writes the system time to the CMOS at intervals. Because the synchronization is performed at intervals (about 11 minutes), after we execute date-s, if the machine is restarted immediately, the modification time may not be written to CMOS, this is the cause of the problem. To make sure the modification takes effect, run the following command.

---- # Clock-W

---- This Command forces the system time to be written into CMOS.
 

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.