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/