3. RTC Test Command in Linux System

3.1. date and hwclock

  • The date command can query / change the current system (software) clock on Linux

Example: Set time

RTCCom002

Example: read time

RTCCom003

  • Hwclock is used to query / change the time of hardware clock (RTC)

Example: query the time of hardware time (RTC)

RTCCom006

Example: write the system time to the RTC time

RTCCom004

Example: write the RTC time to the system time

RTCCom005

(The RTC time can be read automatically when the system is powered on and synchronized to the system clock by adding /bin/hwclock -s to /etc/inittab)