Cisco IOS-XR System Management Command Reference, Release 2.0
Clock Commands on Cisco IOS-XR

Table Of Contents

Clock Commands on Cisco IOS-XR Software

clock read-calendar

clock set

clock summer-time

clock timezone

clock update-calendar

locale country

locale language

show clock


Clock Commands on Cisco IOS-XR Software


This chapter describes the commands to set and view the internal clock settings in the Cisco IOS-XR software.

clock read-calendar

To manually copy the hardware clock (calendar) settings into the software clock, use the clock read-calendar 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

Release
Modification

Release 2.0

This command was introduced.


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, refer to 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. This is separate from the software clock settings, which are erased when the router is powered cycles or rebooted.

Enter the clock read-calendar command to manually copy the hardware clock setting into the software clock.

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/RP1/CPU0:router# clock read-calendar
RP/0/RP1/CPU0:router# show clock

14:31:57.089 PST Tue Feb 10 2004

Related Commands

Command
Description

clock set

Changes the settings for the software system clock.

clock update-calendar

Sets the calendar from the system clock.

ntp update-calendar

Periodically updates the calendar from NTP.


clock set

To change the software system clock settings, enter the clock set command in EXEC mode, using one of the following formats.

clock set hh:mm:ss day month year

clock set hh:mm:ss month day year

Syntax Description

hh:mm:ss

Current time in hours (military format), minutes, and seconds.

day

Current day (by date) in the month.

month

Current month (by name).

year

Current year (no abbreviation). Enter a valid four-digit year.


Defaults

Clock is not set.

Command Modes

EXEC

Command History

Release
Modification

Release 2.0

This command was introduced.


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, refer to 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 system clock. Use this command if no other time sources are available. The time specified in this command is relative to the configured time zone.

Examples

Setting the Software Clock

This example shows how to set the clock using the clock set hh:mm:ss day month year form of the command:

RP/0/RP1/CPU0:router# clock set 14:12:00 10 feb 2004

14:12:00.090 PST Tue Feb 10 2004

This example shows how to set the clock using the clock set hh:mm:ss month day year form of the command:

RP/0/RP1/CPU0:router# clock set 14:38:00 feb 10 2004

14:38:00.069 PST Tue Feb 10 2004

Displaying the Clock Settings

This example shows how to display the settings of the clock:

RP/0/RP1/CPU0:router# show clock

14:38:11.292 PST Tue Feb 10 2004

Displaying the Available Months

This example shows how to display the available months using the online help system:

RP/0/RP1/CPU0:router# clock set 06:10:00 12 ?

  january    Month of the Year
  february
  march
  april
  may
  june
  july
  august
  september
  october
  november
  december

Related Commands

Command
Description

clock summer-time

Configures the system to switch automatically to summer time (daylight savings time).

clock timezone

Sets the time zone for display purposes.

show clock

Displays the clock settings.


clock summer-time

To configure the system to switch automatically to summer time (daylight savings 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 3 on page 47 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 (1 to 5 or last).

day

Day of the week.

month

Month.

hh:mm

Time (military format) in hours and minutes.

offset

(Optional) Number of minutes to add during summer time (default is 60).

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.


Defaults

Summer-time is not configured.

Command Modes

Global configuration

Command History

Release
Modification

Release 2.0

This command was introduced.


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, refer to the Configuring AAA Services on Cisco IOS-XR Software module of the Cisco IOS-XR System Security Configuration Guide.

Use this command if you want to switch automatically to summer time (for display purposes 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 offset setting is 60.

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.

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/RP1/CPU0:router(config)# clock summer-time PDT recurring 1 Sunday April 2:00 last 
Sunday October 2:00

If you live in a place where summer time does not follow the pattern in the first example, you could set it to start on October 12, 2003 at 02:00 and end on April 26, 2004 at 02:00, with the following example. The date keyword indicates that the rules apply for the current year only.

RP/0/RP1/CPU0:router(config)# clock summer-time zone PDT date 12 October 2003 2:00 26 
April 2004 2:00

Related Commands

Command
Description

clock set

Sets the software system clock.

clock timezone

Sets the time zone for display purposes.


clock timezone

To set the time zone for display purposes, 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 [minutes]

no clock timezone

Syntax Description

zone

Name of the time zone to be displayed when standard time is in effect.

+

Positive offset from Coordinated Universal Time (UTC).

-

Negative offset from UTC.

hours

Hours offset from UTC. Range is from -23 to +23.

minutes

(Optional) Minutes offset from UTC.


Defaults

UTC

Command Modes

Global configuration

Command History

Release
Modification

Release 2.0

This command was introduced.


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, refer to the Configuring AAA Services on Cisco IOS-XR Software module of the Cisco IOS-XR System Security Configuration Guide.

The system keeps time internally in UTC, so this command is used only for display purposes and when the time is set manually.

Table 3 lists common time zone acronyms used for the zone argument.

Table 3 Common Time Zone Acronyms 

Acronym
Time Zone Name and UTC Offset
Europe
 

GMT

Greenwich Mean Time, as UTC

BST

British Summer Time, as UTC + 1 hour

IST

Irish Summer Time, as UTC + 1 hour

WET

Western Europe Time, as UTC

WEST

Western Europe Summer Time, as UTC + 1 hour

CET

Central Europe Time, as UTC + 1

CEST

Central Europe Summer Time, as UTC + 2

EET

Eastern Europe Time, as UTC + 2

EEST

Eastern Europe Summer Time, as UTC + 3

MSK

Moscow Time, as UTC + 3

MSD

Moscow Summer Time, as UTC + 4

United States and Canada
 

AST

Atlantic Standard Time, as UTC -4 hours

ADT

Atlantic Daylight Time, as UTC -3 hours

ET

Eastern Time, either as EST or EDT, depending on place and time of year

EST

Eastern Standard Time, as UTC -5 hours

EDT

Eastern Daylight Saving Time, as UTC -4 hours

CT

Central Time, either as CST or CDT, depending on place and time of year

CST

Central Standard Time, as UTC -6 hours

CDT

Central Daylight Saving Time, as UTC -5 hours

MT

Mountain Time, either as MST or MDT, depending on place and time of year

MST

Mountain Standard Time, as UTC -7 hours

MDT

Mountain Daylight Saving Time, as UTC -6 hours

PT

Pacific Time, either as PST or PDT, depending on place and time of year

PST

Pacific Standard Time, as UTC -8 hours

PDT

Pacific Daylight Saving Time, as UTC -7 hours

AKST

Alaska Standard Time, as UTC -9 hours

AKDT

Alaska Standard Daylight Saving Time, as UTC
-8 hours

HST

Hawaiian Standard Time, as UTC -10 hours

Australia
 

WST

Western Standard Time, as UTC + 8 hours

CST

Central Standard Time, as UTC + 9.5 hours

EST

Eastern Standard/Summer Time, as UTC + 10 hours (+11 hours during summer time)


Table 4 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.

Table 4 Single-Letter Time Zone Designators 

Letter Designator
Word Designator
Difference from UTC

Y

Yankee

UTC -12 hours

X

Xray

UTC -11 hours

W

Whiskey

UTC -10 hours

V

Victor

UTC -9 hours

U

Uniform

UTC -8 hours

T

Tango

UTC -7 hours

S

Sierra

UTC -6 hours

R

Romeo

UTC -5 hours

Q

Quebec

UTC -4 hours

P

Papa

UTC -3 hours

O

Oscar

UTC -2 hours

N

November

UTC -1 hour

Z

Zulu

Same as UTC

A

Alpha

UTC +1 hour

B

Bravo

UTC +2 hours

C

Charlie

UTC +3 hours

D

Delta

UTC +4 hours

E

Echo

UTC +5 hours

F

Foxtrot

UTC +6 hours

G

Golf

UTC +7 hours

H

Hotel

UTC +8 hours

I

India

UTC +9 hours

K

Kilo

UTC +10 hours

L

Lima

UTC +11 hours

M

Mike

UTC +12 hours


Examples

The following example sets the time zone to PST and offsets 8 hours behind UTC:

RP/0/RP1/CPU0:router(config)# clock timezone PST -8

The following example sets the time zone to Atlantic Time (AT) for Newfoundland, Canada, which is 3.5 hours behind UTC:

RP/0/RP1/CPU0:router(config)# clock timezone AT -3 30

Related Commands

Command
Description

clock set

Changes the clock settings.

clock summer-time

Configures the system to switch automatically to summer time (daylight savings time).

clock timezone

Sets the time zone for display purposes.

show clock

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

Release
Modification

Release 2.0

This command was introduced.


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, refer to 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 system software clock and calendar are not synchronized, and the system clock is more accurate, use this command to update the hardware calendar clock to the correct date and time.

Examples

The following example copies the current time from the system clock to the calendar:

RP/0/RP1/CPU0:router# clock update-calendar

Related Commands

Command
Description

clock read-calendar

Copies the hardware (calendar) clock settings into the software system clock.


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 country

Syntax Description

country

Specifies the country, where country is a two-character country code.


Defaults

No default behavior or values

Command Modes

Global configuration

Command History

Release
Modification

Release 2.0

This command was introduced.


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, refer to 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 view a complete listing of the available country codes, use the online help system:

RP/0/RP1/CPU0:router(config)# locale country ?

  AD    Andorra
  AE    United Arab Emirates
  AF    Afghanistan
  AG    Antigua and Barbuda
  AI    Anguilla
  AL    Albania
  AM    Armenia
  AN    Netherlands Antilles
  AO    Angola
  AQ    Antarctica
  AR    Argentina
  AS    American Samoa
  AT    Austria
  AU    Australia
  AW    Aruba
  AZ    Azerbaijan
  BA    Bosnia and Herzegovina
  BB    Barbados
  BD    Bangladesh
  BE    Belgium
--More-- 

Examples

The following example sets the country of use to Australia:

RP/0/RP1/CPU0:router(config)# locale country au

Related Commands

Command
Description

locale language

Sets the default language.


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 language

Syntax Description

language

Specifies the language, where language is a two-character code.


Defaults

No default behavior or values

Command Modes

Global configuration

Command History

Release
Modification

Release 2.0

This command was introduced.


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, refer to 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.


Use online help to get a complete listing of the available language codes:

RP/0/RP1/CPU0:router(config)#locale language ?

  aa    Afar
  ab    Abkhazian
  af    Afrikaans
  am    Amharic
  ar    Arabic
  as    Assamese
  ay    Aymara
--More--

Examples

The following example sets the language in use to English:

RP/0/RP1/CPU0:router(config)# locale language en

Related Commands

Command
Description

locale country

Sets the default country.


show clock

To display the system clock, use the show clock command in EXEC mode.

show clock [detail]

Syntax Description

detail

(Optional) Indicates the clock source and the current summer time setting (if any).


Command Modes

EXEC

Command History

Release
Modification

Release 2.0

This command was introduced.


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, refer to 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 NTP), the flag is set. If the time is not authoritative, it will be used only for display purposes. 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 5 describes the leading symbols that precede the show clock display.

Table 5 show clock Display Leading Symbol Descriptions

Symbol
Description

*

Time is not authoritative.

(blank)

Time is authoritative.

.

Time is authoritative, but NTP is not synchronized.


Examples

The following sample output shows the current clock settings:

RP/0/RP1/CPU0:router# show clock

16:18:28.927 PST Tue Feb 10 2004

The following sample output shows the current clock detail, including the time source:

RP/0/RP1/CPU0:router# show clock detail

16:18:07.164 PST Tue Feb 10 2004
Timezone: PST8PST Timesource: User configured

Related Commands

Command
Description

clock set

Sets the system clock manually.