Solution for Linux with a time of 8 hours

Source: Internet
Author: User
Tags cst time

Many may ask why the system time is eight hours faster than the current time because my CMOS time is the correct current time and the Beijing time zone is also set in Linux.

 

To solve this problem, first confirm whether the current time displayed by the current CMOS is the current time. If yes, your CMOS is not UTC time (that is, the CST local time) and you need to modify

In the/etc/sysconfig/clock file, change UTC = true to UTC = false (tell the Linux hardware to set the local time)

This is the reason that most of the time is 8 hours faster, because the default option for Linux installation is to use UTC time (CMOs on foreign computers may be set to UTC time ), the system mistakenly believes that your CMOS is UTC time, and you have selected the + 8 time zone, so Linux adds 8 hours of CMOS time as the system time.

 

 

 

Change Time Zone

Rm/etc/localtime

Ln-S/usr/share/zoneinfo/Asia/Shanghai/etc/localtime

 

Read hardware time to System

Clock -- hctosys

 

Enter date to check whether the current CST time is used (CST indicates the local time, for example, Shanghai we set). If the time is incorrect, use the following method to modify the time:

Date-s 12:00:00

 

Write System Time to hardware

Clock -- systohc

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.