Linux in a Nutshell, Third Edition
by Ellen Siever, Stephen Spainhour, Jessica P. Hekman, Stephen Figgins
Name
hwclock
Synopsis
hwclock [options]
Description
System administration command. Read or set the hardware clock. This command maintains change information in /etc/adjtime, which can be used to adjust the clock based on how much it drifts over time. hwclock replaces the clock command. The single-letter options are included for compatibility with the older command.
Options
You may specify only one of the following options:
- -a
Adjust the hardware clock based on information in /etc/adjtime and set the system clock to the new time.
- --adjust
Adjust the hardware clock based on information in /etc/adjtime.
- --date date
Meaningful only with the --set option. date is a string appropriate for use with the date command.
- --debug
Print information about what hwclock is doing.
- -r, --show
Print the current time stored in the hardware clock.
- -s, --hctosys
Set the system time in accordance with the hardware clock.
- --set
Set the hardware clock according to the time given in the --date parameter.
- --test
Do not actually change anything. This is good for checking syntax.
- -u, --utc
The hardware clock is stored in Universal Coordinated Time.
- --version
Print version and exit.
- -w, --systohc
Set the hardware clock in accordance with the system time.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access