Setting the Router’s Time

The router’s internal clock is set with the clock set command. This command is not a configuration command (i.e., you must be in enable mode to give it, but you don’t need to give the configure terminal command) and is not stored in the router’s configuration. The time is in military (24-hour) time. For example:

Router#clock set 13:00:00 20 jun 1999

In addition to setting the time itself, you need to set the time zone using the clock timezone command. This command is part of the router’s configuration. For example, a router on the east coast of the United States would have the line:

Router(config)#clock timezone EST -5

-5 is the UTC (Coordinated Universal Time) offset for the Eastern time zone.

Now that the time and time zone have been set, one final configuration item exists: in most places, you want to observe Daylight Savings Time. The following command tells the router to use Daylight Savings Time in the Eastern time zone:

Router(config)#clock summer-time EDT recurring

The Calendar Versus the Clock

High-end Cisco routers have a calendar that is separate from the system clock. The calendar runs continuously, even if the router is off. After the calendar has been set, the system clock automatically sets itself every time the router is booted. The following commands set the router’s calendar and set the clock’s time from the calendar time. The calendar set command simply sets the time, and is not stored in the router’s configuration.

Router#calendar ...

Get CISCO IOS in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.