Debian 7 wheezy Time Setup

Source: Internet
Author: User
Tags time zones local time set time linux

After installing Debian or other Linux distributions, it is easy to encounter a problem that is not time, such as the BIOS time and system time is not the same. This is because the Debian default BIOS time is UTC (Universal times coordinated) 0 time zone times, if the time zone is selected at installation time, such as Asia/shanghai Utc+8, East 8 area, The system adds 8 hours to the CST, or China standard Time, based on the BIOS time.

1. System time and hardware time

The Linux system has two time concepts, system time and hardware time.

The hardware time is the time in the BIOS, which is considered a UTC 0 Time zone and can be hwclock to view the hardware time.

The system time is the time that is checked with the date command, which is determined by the system by reading the BIOS time and according to the set time zone in the system.

2. How to set up

step-0: Adjusting time zones

$sudo Tzselect

Step-1:

$sudo Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime

Step-2: Modifying/etc/adjtime files

Consider the BIOS time as local time and turn off the UTC option in Debian. Many articles refer to modifying the Utc=no in/etc/default/rcs, which is the setup method of Debian 6 (which I did not verify), while Debian 7 placed this option in the/etc/adjtime file, and if this file is not available, the command $sudo Hwclock--adjust to generate. The third line is then changed from UTC to Local.

Step-3: Modifying system time

$sudo Hwclock--hctosys writes the hardware time to the system time.

Step-4: Sync Time

$sudo Apt-get Install Ntpdate

$sudo ntpdate 129.6.15.28

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

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.