Ubuntu 16.04 writes system time to hardware time bios

Source: Internet
Author: User
Tags time zones

On a Linux computer, there are two times, one is the hardware time (the time recorded in the BIOS, called Hwclock), and the other is the operating system time (Osclock). Hardware clock powered by the BIOS battery, when the computer shuts down, will continue to run, the BIOS battery can generally be used for several years, if the power is not available, the BIOS data will be restored to factory settings.

Hardware time

Time is available with time zones, regardless of hardware time or operating system time. The time zone of the Hwclock is set in the/etc/default/rcs file with a parameter of UTC, the default value of true, which means that the UTC time zone is used, and if set to No, the time zone of the osclock is used. It is recommended that the Hwclock be set to the same time zone as Osclock. Note: Because my osclock is also UTC time, so here Utc=yes or Utc=no are the same.

# Assume the BIOS clock is set to UTC time (recommended) Utc=yes

Viewing hardware time

sudo hwclock-r

Write Osclock to Hwclock

sudo hwclock-w

Operating system time

Osclock time zone profile for/etc/timezone, if you want to modify, it is best to use sudo dpkg-reconfigure tzdata to modify the time zone, do not recommend directly modify the/etc/timezone file, if you want to modify the UTC time, When executing the sudo dpkg-reconfigure tzdata command, select none of the ABOVE->UTC to

Cat/etc/timezoneetc/utc

View Osclock

Date

Modify Osclock

#修改时/min/sec sudo date-s hh:mm:ss# modified year/month/day sudo date-s mm/dd/yy

Reference:

Https://www.cnblogs.com/ajianbeyourself/p/4189520.html (the above content is transferred from this article)

Ubuntu 16.04 writes system time to hardware time bios

Related Article

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.