先简单介绍date与hwclock的异同。本文引用地址:http://www.eepw.com.cn/article/201610/305939.htm
相同点:都是表示时间的。
差异点:
date 是表示系统的时间,假如在系统启动时没有设置的话,系统都会从1970年开始。
hwclock是表示硬件的时间,如时钟芯片或主芯片自带的rtc里面的时间。
Date就不做介绍了,看下hwclock
# hwclock --help
BusyBox v1.14.1 (2010-01-22 10:35:16 CST) multi-call binary
Usage: hwclock [-r] [-s] [-w] [-l] [-u] [-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. /dev/rtc2)
应该说解释的很详细了,但是-s与-w选项,我个人觉得解释的会让人误解,可以这么理解
-s Set system time from hardware clock 从硬件时钟读取数据到系统时钟,主要用于刚开始时,系统时钟从硬件时钟读取时间信息,如果没有这步