In this How To, we will discuss the clock setting in IOS.
When Cisco IOS boots up, the default date and time is set to March 1, 1993. You can view this using the 'show clock' command:
cell_pe1> show clock
*00:01:10.415 UTC Mon Mar 1 1993
It isn't necessary for a router to have the clock time properly set to be fully operational. That said, there may be reasons to set the time properly on the platform. Here are some of the advantages of setting the time clock:
- You can schedule command execution using the routers kron scheduler
- Your log files will display the proper time stamp on events, and management communications will reflect local time and date for network troubleshooting purposes
- The correct time allows you to make connections between two different times
Begin by Setting the Time Zone
To acomplish the proper configuration of the routers clock, we begin by setting the time zone in Cisco IOS. If you set the time first and then try to set to the time zone, you'll have to reset the time again. Setting Time Zone is a bit tricky in that you need to know how many hours you are from Greenwich Mean Time (GMT), not that you're in the Eastern or Pacific time zone. For example, if you're in the Central Standard Time (CST) zone in the United States, you're six hours behind GMT. You would indicate this to the router with -6. If you're unsure how many hours you are from GMT, the U.S. Navy's Web site offers a great resource-the World Time Zone Map . After you've determined your time zone value, you can set the time zone. For example, I live in the Pacific Standard Time (PST) zone, the configuration would be:
cell_pe1(config)# clock timezone CST -8
Now Configure Daylight Saving Time
After setting the appropriate time zone, you need to configure the router to adjust for Daylight Saving Time . You can use the summer-time command to accomplish this. Using our PST zone example above, this is the next configurations step:,
cell_pe1(config)# clock summer-time PDT recurring
The summer-time command tells the router to refer to Daylight Saving Time as Pacific Daylight Time (CDT), which will automatically occur according to predefined dates and times on the router. (You can use the same command to manually set the date and time for Daylight Saving Time.) The recurring option tells the router to use the accepted U.S. Daylight Saving Time rules for the annual time changes in April and October.
Next Configure the Router Clock
After configuring the time zone and Daylight Saving Time, the final step is to configure the router's clock. You must do this while in Privileged Mode-not Global Configuration Mode. The format for setting the clock follows some rules:
- Use the clock set command.
- Use military time.
- Include seconds when setting the time.
- Specify the month using its three-letter abbreviation.
- Add the date and the year.
Here's an example:
cell_pe1# clock set 11:45:00 Jun 13 2005
Verification of Configuration
After performing the above steps, you can verify your settings are correct by:
cell_pe1# show clock
11:45:21.107 PDT Wed Jun 13 2005
Cisco routers and switches don't have internal clocks that store the time when you power them off. This means rebooting a device will reset the clock to the default IOS time mentioned above. However, the time zone will remain set because the router stores it in its configuration.
For more information on Cisco IOS time configuration, check outCisco's documentation for the various clock commands . You can also use Network Time Protocol (NTP) for time synchronization on Cisco routers. Look elsewhere in our Tech Tips for information regarding use of the NTP protocol.