Skip to Content
Cisco IOS Cookbook, 2nd Edition
book

Cisco IOS Cookbook, 2nd Edition

by Kevin Dooley, Ian Brown
December 2006
Intermediate to advanced
1188 pages
72h 8m
English
O'Reilly Media, Inc.
Content preview from Cisco IOS Cookbook, 2nd Edition

Setting the Time

Problem

You want to set the clock on the router.

Solution

You can set the internal system clock, using the clock set in Enable mode:

Router#clock set 14:27:22 January 29 2006
Router#

Some high-end routers, such as 4500 series, 7000 series, 7200 series, and 7500 series, have a battery protected calendar function that continues to keep time even if the router is temporarily powered off. You can set this calendar function by using the calendar set command in Enable mode:

Router#calendar set 14:34:39 January 29 2006
Router#

In both cases the router will accept either “hh:mm:ss day month year” or “hh:mm:ss month day year” notation.

Discussion

Every Cisco router has an internal system clock. When the router boots, the internal system clock starts to maintain the current date and time. If there is no battery-protected calendar in the router, the clock starts with a default initial value of Monday, March 1, 1993 at midnight. If you want accurate time, either you need to set it manually as shown above, or you need an automated method for setting it as in Recipe 14.5.

Most high-end routers have an internal battery-powered clock called a calendar. Router calendars are able to maintain accurate time and date information even during power interruptions. When the router initializes, it automatically synchronizes the internal system clock with the date stored with the calendar.

You can view the current calendar time by using the following command:

Router>show calendar 14:34:39 UTC Sun Jan ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Cisco ACI Cookbook

Cisco ACI Cookbook

Stuart Fordham
Cisco Router Configuration Handbook, Second Edition

Cisco Router Configuration Handbook, Second Edition

Dave Hucaby - CCIE No. 4594, Steve McQuerry - CCIE No. 6108, Andrew Whitaker

Publisher Resources

ISBN: 0596527225Errata Page