The clock set
Command
If the system time is synchronized by a valid outside timing
mechanism, such as a Network Time Protocol (NTP), or if it can be set using the
router hardware clock, it shouldn’t be necessary to set the software clock. Use
this command if no other time sources are available.
To set the router’s time and date manually, use the privileged
EXEC clock set command. This command isn’t available in
Configuration mode. The time specified in this command is relative to the
configured time zone. The command syntax is either of the following:
Rtr1#clock set hh:mm:ss day month year
Rtr1#clock set hh:mm:ss month day year
There are no defaults and all elements are required, even the
seconds. The following example sets the time to 6:15 P.M. on December 15, 2004.
While the full month can be typed out, it’s only necessary to type the first
three letters. The output is the same, regardless of whether the entry is
abbreviated or the case of the entry.
Rtr1#clock set 18:15:00 15 december 2004
Rtr1#show clock
18:15:28.279 PST Wed Dec 15 2004
Rtr1#
Setting the Software Clock from the Hardware Clock
If the router has a hardware-based clock, it’s possible to
set the software clock to the new hardware clock setting by using the following
privilege EXEC mode command. If the router
doesn’t have a hardware clock, the command is rejected.
Rtr1#clock read-calendar
Setting the Hardware Clock
To update the hardware clock with the current software clock
setting, use the following privilege EXEC mode command. If the
router doesn’t have a hardware clock, the command is rejected.
Rtr1#clock update-calendar
You can periodically update the hardware clock (calendar) from a
NTP time source, using the global configuration ntp
update-calendar command. To disable the periodic updates, use the no form of
this command.
Rtr1(config)#ntp update-calendar
Rtr1(config)#no ntp update-calendar