DGS-6604
m
clock set
CLI Reference Guide
117
clock set
Use this command to manually set the system clock.
clock set
HH:MM:SS DAY MONTH YEAR
Default
Hardware Generated - 00:00:00 01 January 1993
Command Mode
Privileged EXEC at Privilege level 15
Usage Guideline
Generally, if the system is synchronized by a valid outside timing mechanism,
such as SNTP, it is not necessary to set the clock manually. Use this command if
no other time sources are available. Use the
clock timezone command on
page 120
to configure the time zone applied to the clock settings. The clock
configured by this command will be applied to RTC if it is available. The
configured clock will not be stored in the configuration file.
If the clock is manually set and the SNTP server is configured, the system will still
try to sync the clock with the server. If time sync is successful, the SNTP server
set time replaces the manually set time.
If the SNTP state changes from enabled to disabled, the system clock continues
operations but no longer attempts to sync time with the server.
Example
The following example shows how to manually set the software clock to 6:00
p.m. on Aug 22, 2010:
Verify the settings by entering the
show clock
command.
Syntax Description
HH:MM:SS
Current time in hours (24-hour format), minutes and seconds.
DAY
Current day (by date) in the month.
MONTH
Current month (by name, January, Jan, February, Feb, and so on).
YEAR
Current year (no abbreviation).
Switch# clock set 18:00:00 22 Aug 2010
Switch#