Hardware clock and time zone issues

Source: Internet
Author: User
Tags local time

The Development Board needs to display the clock before long, but the default is UTC time, so increase the time zone file.

Copy the Shanghai time zone/usr/share/zoneinfo/asia/shanghai file for localtime to/etc
cp/usr/share/zoneinfo/asia/shanghai/etc/ LocalTime

However, when debugging the clock, it is found that when the time is set and written to the hardware, the boot is always 8 hours fast.

The survey found that writing to the hardware used hwclock-w, the default is to write local time, and when the kernel is in UTC to write time, just increased by 8 hours.

So speak hwclock-w change Hwclock-uw can work normally.

Hwclock:invalid option--y
BusyBox v1.15.2 (2009-10-26 18:24:41 CST) multi-call binary usage:hwclock

[-r|--show ] [-s|--hctosys] [-W|--SYSTOHC] [-l|--localtime] [-U|--UTC] [F-FILE]

Query and set hardware clock (RTC)

Options: -
        R      Show hardware clock time-
        s      set system time from hardware clock-
        w      set hardware clock to System TIME
 -u      hardware clock is in UTC
        -L hardware clock is in local time
        -F FILE use specified device (e.g./d EV/RTC2)


~end~

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.