Set Time and date.
hwclock - query and set the hardware clock (RTC)
hwclock is a tool for accessing the Hardware Clock. You can display
the current time, set the Hardware Clock to a specified time, set the
Hardware Clock to the System Time, and set the System Time from the
Hardware Clock.
You can also run hwclock periodically to insert or remove time from the
Hardware Clock to compensate for systematic drift (where the clock con-
sistently gains or loses time at a certain rate if left to run).
hwclock -r or hwclock --show
hwclock -w or hwclock --systohc
hwclock -s or hwclock --hctosys
hwclock -a or hwclock --adjust
hwclock -v or hwclock --version
hwclock --set --date=newdate
hwclock --getepoch
hwclock --setepoch --epoch=year
other options:
[-u|--utc] --localtime --noadjfile --directisa --test [-D|--debug]
and arcane options for DEC Alpha:
[-A|--arc] [-J|--jensen] [-S|--srm] [-F|--funky-toy]
Minimum unique abbreviations of all options are acceptable.
Also, -h asks for a help message.
Follow the steps
1.check date with date command
2.set date with date -s command
3.hwclock --systohc
4.hwclock --show
Use the following syntax to set new data and time:
date --set="STRING"
date -s "3 MAR 2011 18:00:00"
date --set="3 MAR 2011 18:00:00"
date +%Y%m%d -s "20110303"
To set time use the following syntax:
date +%T -s "12:03:03"
Comments
Post a Comment