Книга: Fedora™ Unleashed, 2008 edition
Using the hwclock Command
Using the hwclock
Command
Use the hwclock
command to display or set your Linux system time, display or set your PC's hardware clock, or to synchronize the system and hardware times. To see your hardware date and time, use hwclock
with its --show
option like so:
# hwclock --show
Fri 27 Jan 2006 02:17:53 PM GMT -0.193809 seconds
Use hwclock
with its --set
and --date
options to manually set the hardware clock like so:
# hwclock --set --date "01/27/06 08:00:00"
# hwclock --show
Tue 27 Jan 2006 08:00:08 AM GMT -0.151718 seconds
In these examples, the hardware clock has been set with hwclock
, which is then used again to verify the new hardware date and time. You can also hwclock
to set the Linux system date and time date, using your hardware clock's values with the Linux system date and time.
For example, to set the system time from your PC's hardware clock, use the --hctosys
option as follows:
# hwclock --hctosys
- Using the date Command
- 4.4.4 The Dispatcher
- About the author
- Chapter 7. The state machine
- Appendix A. Detailed explanations of special commands
- Appendix E. Other resources and links
- Caveats using NAT
- Example NAT machine in theory
- Using Double Quotes to Resolve Variables in Strings with Embedded Spaces
- The final stage of our NAT machine
- Compiling the user-land applications
- The conntrack entries