![]() |
Table Of Contents
Clock Commands on Cisco IOS XR Software
Clock Commands on Cisco IOS XR Software
This chapter describes the commands used to set and display the internal clock settings in the Cisco IOS XR software.
For more information about manually setting the router clock, see Cisco IOS XR Getting Started Guide.
For more information about configuring the router to synchronize to Network Time Protocol (NTP), see the Implementing NTP on Cisco IOS XR Software module in Cisco IOS XR System Management Configuration Guide.
clock read-calendar
To manually copy the hardware clock (calendar) settings into the software clock, use the clock read-calendar command in EXEC mode.
clock read-calendar
Syntax Description
This command has no arguments or keywords.
Defaults
Read calendar is disabled.
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
The "calendar" clock is a hardware system clock that runs continuously, even if the router is powered off or rebooted. The hardware system clock is separate from the software clock settings, which are erased when the router is power cycled or rebooted.
Use the clock read-calendar command to manually copy the hardware clock setting into the software clock.
Task ID
Examples
In the following example, the hardware clock settings are copied to the software clock with the clock read-calendar command. The show clock command is then entered to display the new software clock settings.
RP/0/RP0/CPU0:router# clock read-calendarRP/0/RP0/CPU0:router# show clock14:31:57.089 PST Tue Feb 10 2005Related Commands
Command DescriptionSets the software clock settings.
Sets the calendar from the software clock.
Displays the clock settings.
update-calendar
Periodically updates the calendar from NTP.
clock set
To change the software clock settings, use the clock set command in EXEC mode.
clock set hh:mm:ss {day month year | month day year}
Syntax Description
Defaults
Clock is not set.
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Generally, if the system is synchronized by a valid outside timing mechanism, such as a Network Time Protocol (NTP) clock source, or if you have a networking device with calendar capability, you need not set the software clock. Use the clock set command if no other time sources are available. The time specified in this command is relative to the configured time zone.
Task ID
Examples
Setting the Software Clock
This example shows how to set the software clock using the clock set hh:mm:ss day month year form of the command:
RP/0/RP0/CPU0:router# clock set 14:12:00 10 feb 200514:12:00.114 JST Fri Feb 10 2005This example shows how to set the software clock using the clock set hh:mm:ss month day year form of the command:
RP/0/RP0/CPU0:router# clock set 14:38:00 feb 10 200514:38:00.069 PST Tue Feb 10 2005Displaying the Clock Settings
This example shows how to display the settings of the software clock:
RP/0/RP0/CPU0:router# show clock14:38:11.292 PST Tue Feb 10 2005Displaying the Available Months
This example shows how to display the available months using the online help (?) system:
RP/0/RP0/CPU0:router# clock set 06:10:00 12 ?january Month of the YearfebruarymarchaprilmayjunejulyaugustseptemberoctobernovemberdecemberRelated Commands
Command DescriptionConfigures the system to switch automatically to summer time (daylight saving time).
Sets the time zone for display.
Displays the clock settings.
clock summer-time
To configure the system to switch automatically to summer time (daylight saving time), use the clock summer-time command in global configuration mode. To remove the clock summer-time setting, use the no form of this command.
clock summer-time zone {recurring week day month hh:mm week day month hh:mm [offset] | date {date month year hh:mm date month year hh:mm | month date year hh:mm month date year hh:mm} [offset]}
no clock summer-time
Syntax Description
zone
Name of the time zone (for example, PDT) to be displayed when summer time is in effect. Table 14 on page 90 lists common time zone acronyms used for the zone argument.
recurring
Indicates that summer time should start and end on the corresponding specified days every year.
week
Week of the month (values are 1 to 5, first or last).
day
Day of the week.
month
Month.
hh:mm
Time (24-hour format) in hours and minutes.
offset
(Optional) Number of minutes to add during summer time. The default is 60 minutes (1 hour).
date
Indicates that summer time should start on the first specific date listed in the command and end on the second specific date in the command.
date
Date of the month.
year
Year (no abbreviation).
Defaults
Summer time is not configured.
offset: 60 minutesCommand Modes
Global configuration
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Use the clock summer-time command if you want the system to switch automatically to summer time (for display only):
•
Use the recurring form of the command to apply the rules on the configured day each year. If clock summer-time zone recurring is specified without parameters, the summer time rules default to United States standards. The default for the offset argument is 60 minutes.
•
Use the date form to specify a start and end date for summer time if you cannot use the first form.
In both forms of the command, the first part of the command specifies when summer time begins, and the second part specifies when it ends. All times are relative to the local time zone. The start time is relative to standard time. The end time is relative to summer time. If the starting month is after the ending month, the system assumes that you are in the Southern Hemisphere.
Task ID
Examples
The following example specifies that summer time starts on the first Sunday in April at 02:00 and ends on the last Sunday in October at 02:00. The recurring keyword indicates that the rules apply every year.
RP/0/RP0/CPU0:router(config)# clock summer-time PDT recurring 1 Sunday April 2:00 last Sunday October 2:00If you live where summer time does not follow the pattern in the first example, you could set it to start on October 12, 2005 at 02:00 and end on April 26, 2006 at 02:00, with the following example. The date keyword indicates that the rules apply for the current year only.
RP/0/RP0/CPU0:router(config)# clock summer-time PDT date 12 October 2005 2:00 26 April 2006 2:00Related Commands
clock timezone
To set the time zone for display, use the clock timezone command in global configuration mode. To remove the clock timezone setting, use the no form of this command.
clock timezone zone hours-offset [minutes-offset]
no clock timezone
Syntax Description
Defaults
UTC
Command Modes
Global configuration
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Use the clock timezone command only to display the time zone when setting the time manually. The system keeps time internally in UTC.
Table 14 lists common time zone acronyms used for the zone argument.
Table 15 lists an alternative method for referring to time zones, in which single letters are used to refer to the time zone difference from UTC. Using this method, the letter Z is used to indicate the zero meridian, equivalent to UTC, and the letter J (Juliet) is used to refer to the local time zone. Using this method, the International Date Line is between time zones M and Y.
Task ID
Examples
The following example shows how to set the time zone to PST and offset 8 hours behind UTC:
RP/0/RP0/CPU0:router(config)# clock timezone PST -8The following example shows how to set the time zone to Atlantic Time (AT) for Newfoundland, Canada, which is 3.5 hours behind UTC:
RP/0/RP0/CPU0:router(config)# clock timezone AT -3 30Related Commands
Command DescriptionSets the software clock settings.
Configures the system to switch automatically to summer time (daylight saving time).
Sets the time zone for display.
Displays the clock settings.
clock update-calendar
To copy the software clock settings to the hardware clock (calendar), use the clock update-calendar command in EXEC mode.
clock update-calendar
Syntax Description
This command has no arguments or keywords.
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
The hardware clock (calendar) runs continuously, even if the router is powered off or rebooted. If the software clock and calendar are not synchronized and the software clock is more accurate, use this command to update the hardware calendar clock to the correct date and time.
Task ID
Examples
The following example shows how to copy the current time from the software clock to the hardware clock:
RP/0/RP0/CPU0:router# clock update-calendarRelated Commands
locale country
To set the default country of use, use the locale country command in global configuration mode. To remove the locale country setting, use the no form of this command.
locale country country
no locale country
Syntax Description
Defaults
No default behavior or values
Command Modes
Global configuration
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Note
This command is not fully supported at this time.
To display a complete listing of the available country codes, use the online help (?) function:
RP/0/RP0/CPU0:router(config)# locale country ?AD AndorraAE United Arab EmiratesAF AfghanistanAG Antigua and BarbudaAI AnguillaAL AlbaniaAM ArmeniaAN Netherlands AntillesAO AngolaAQ AntarcticaAR ArgentinaAS American SamoaAT AustriaAU AustraliaAW ArubaAZ AzerbaijanBA Bosnia and HerzegovinaBB BarbadosBD BangladeshBE Belgium--More--Task ID
Examples
The following example shows how to set the country of use to Australia:
RP/0/RP0/CPU0:router(config)# locale country auRelated Commands
locale language
To set the default language of use, use the locale language command in global configuration mode. To remove the locale language setting, use the no form of this command.
locale language language
no locale language
Syntax Description
Defaults
No default behavior or values
Command Modes
Global configuration
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
Note
This command is not fully supported at this time.
To display a complete listing of the available language codes, use the online help (?) function:
RP/0/RP1/CPU0:router(config)# locale language ?aa Afarab Abkhazianaf Afrikaansam Amharicar Arabicas Assameseay Aymara--More--Task ID
Examples
The following example shows how to set the language of use to English:
RP/0/RP0/CPU0:router(config)# locale language enRelated Commands
show clock
To display the system clock, use the show clock command in EXEC mode.
show clock [detail]
Syntax Description
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
The system clock keeps an "authoritative" flag that indicates whether the time is authoritative (believed to be accurate). If the system clock has been set by a timing source, such as system calendar or Network Time Protocol (NTP), the flag is set. If the time is not authoritative, it is used only for display. Until the clock is authoritative and the "authoritative" flag is set, the flag prevents peers from synchronizing to the clock when the peers have invalid times.
Table 16 describes the leading symbols that precede the show clock display.
Table 16 show clock Display Leading Symbol Descriptions
Symbol Description*
Time is not authoritative.
(blank)
Time is authoritative.
.
Time is authoritative, but NTP is not synchronized.
Task ID
Examples
The following sample output shows the current clock settings:
RP/0/RP0/CPU0:router# show clock16:18:28.927 PST Tue Feb 10 2005The following sample output shows the current clock detail, including the time source:
RP/0/RP0/CPU0:router# show clock detail16:18:07.164 PST Tue Feb 10 2005Timezone: PST8PST Timesource: User configuredRelated Commands
show clock sync
To show the time difference between the clocks on route processors (RPs) and other line cards (LCs) in a Cisco XR 12000 Series Router, use the show clock sync command in EXEC command mode.
show clock sync
Syntax Description
This command has no arguments or keywords.
Defaults
Displays the clock time for each RP, distributed route processor (DRP), or LC in a secure domain router (SDR), relative to the clock time on the RP where the command is entered.
Command Modes
EXEC
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
In a router running the Cisco IOS XR software, the time clock in the primary RP is synchronized with the other RPs, DRPs, and LCs in the system. This synchronization ensures that the standby RP has an accurate time setting if it assumes the primary role and that the events in logs between different RPs, LCs, and DRPs can be easily correlated during debugging.
The show clock sync command verifies that the cards in a Cisco XR 12000 Series Router are synchronized with the primary RP. When this command is run, the primary RP queries the clocks on each card in the system and displays the time difference between each card and the primary RP. If the time setting on the card is different from the time on the primary RP, the display shows if the clock on the card is being adjusted to synchronize with the primary RP.
Note
The show clock sync command shows the relative time difference between the RP where it is run, and the cards for that SDR. If the command is run on the primary RP for the owner SDR, then the results show the relative time settings for the cards assigned to the owner SDR. If the command is run on the DSDRSC for a non-owner SDR, then the results are for the cards in that SDR. The show clock sync command can also be run on the standby RP, but the times displayed are relative to that RP.
Task ID
Examples
The following is sample output from the show clock sync command:
RP/0/0/CPU0:router# show clock syncRoundTrip TimeSlot Card Delay Offset Local Time----------------------------------------------------------------------0 RP Card 0 ms 0.000 s 16:00:05.798 UTC Sun Apr 09 20061 RP Card 1 ms 0.001+s +16:00:05.798 UTC Sun Apr 09 20062 Line Card 2 ms 0.000 s -16:00:05.798 UTC Sun Apr 09 20063 Line Card 15 ms 0.004+s -16:00:05.802 UTC Sun Apr 09 20064 Line Card 1 ms 0.001+s -16:00:05.798 UTC Sun Apr 09 20065 Line Card 2 ms 0.002+s +16:00:05.799 UTC Sun Apr 09 2006Table 17 describes the significant fields shown in the display.
Table 17 show clock sync Field Descriptions
Field DescriptionSlot
Physical slot number of the card.
Card
Type of card on the specified slot.
RoundTrip Delay
Time (in milliseconds) required for the test message to travel between the RP and LC and back.
Time Offset
Time difference (in seconds) between cards shown in the display.
Local Time
Displays the system clock setting. This is the same as the output displayed with the command show clock. The positive (+) or negative (-) sign is added if the card is being adjusted to run faster or slower.
Related Commands