hwclock & date

Category: Linux commands
------------------------------------------------------------

date : command returns system-time in human readable format. The term human readable is because system time is a counter which counts numbers of ticks passed after a reference date called epoch (1st Jan 1970 00:00:00)
hwclock : command returns actual hardware RTC time

At every power on if hardware RTC is in place, then Linux kernel will read the hardware RTC and will set the system time accordingly, if the RTC is not present or un-available then the system will be set to epoch.

To set the system time use:
date -s "YYYY-MM-DD HH:MM:SS"
date -s "2010-07-20 12:58:00"

To just adjust system time use:
date -s 12:59

To set hardware RTC from system time use:
hwclock -w

------------------------------------------------------------

Comments