2.9. Time&Timezone Commands

2.9.1. clock set datetime

Command Purpose

Use this command to set system current date and time on the Switch.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

clock set datetime HH:MM:SS MONTH DAY YEAR

Parameter

Parameter Description

Parameter Value

HH:MM:SS

Specify the time in hours (24-hour format), minutes, and seconds. The time specified is relative to the configured time zone

HH:MM:SS in 24-hour format.

MONTH

Specify the month by name

Should be in range 1 to 12

DAY

Specify the day by date in the month

Should be in range 1 to 31

YEAR

Specify the year

Should be in range 1993 to 2035

Command Mode

Global Config

Default

The default time is based from UTC.

Usage

If no other source of time is available, you can manually configure the time and date after the system is restarted. The time remains accurate until the next system restart. We recommend that you use manual configuration only as a last resort. If you have an outside source to which the switch can synchronize, you do not need to manually set the system clock.

Examples

This example shows how to manually set the system clock to 18 hours 43 minutes 00 seconds on October 23, 2024:

Switch# configure terminal
Switch(config)# clock set datetime 18:43:00 10 23 2024

2.9.2. clock set timezone

Command Purpose

Use this command to set the time zone on the Switch.

To restore to the default time of UTC, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

clock set timezone ZONE ( add | minus ) hours-offset [ minutes-offset ] [ seconds-offset ]

no clock set timezone

Parameter

Parameter Description

Parameter Value

ZONE

Specify the zone name

the length should be [3, 32), and only [a-zA-Z] is supported, and the first and last character must be alphabet.

add

Specify the time offset is positive from UTC

-

minus

Specify the time offset is negative from UTC

-

HOUR_OFFSET

Specify the time offset in hours

0-18

MINUTES_OFFSET

[optional]Specify the time offset in minutes, should be in range 0 to 59

0-59

SECONDS_OFFSET

[optional]Specify the time offset in seconds

0-59

Command Mode

Global Config

Default

The default time zone should be UTC.

Usage

None

Examples

The following example sets the Atlantic Canada time zone is 3.5 hours less than UTC:

Switch# configure terminal
Switch(config)# clock set timezone Canada minus 3 30

The following example sets the time zone named ZZZ is 5 hours faster than UTC:

Switch# configure terminal
Switch(config)# clock set timezone ZZZ add 5

Related Commands

show clock (detail)

2.9.3. clock set summer-time

Command Purpose

Use this command to set summer time (daylight saving time) in areas where it starts and ends on a particular day each year(recurring) or on specified year(date).

To restore to the default time of UTC, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

clock set summer-time ZONE recurring start-time end-time offset

clock set summer-time ZONE date start-time end-time offset

no clock set summer-time

Parameter

Parameter Description

Parameter Value

ZONE

Specify the summer zone name

The length should be [3, 32), and only [a-zA-Z] is supported, and the first and last character must be alphabet.

recurring

Specify that summer time starts and ends on a particular day of the week each year

-

date

Specify that summer time starts and ends on a particular day of the specified year

-

START_TIME

Specify the start time of summer time

For recurring summer time, the format should be month, day, hh:mm:ss or (first | second | third | fourth | last) DAY <1-12> HH:MM:SS, while for date summer time, the format should be month, day, year, hh:mm:ss

END_TIME

Specify the end time of summer time

For recurring summer time, the format should be month, day, hh:mm:ss or (first | second | third | fourth | last) DAY <1-12> HH:MM:SS, while for date summer time, the format should be month, day, year, hh:mm:ss

OFFSET

For offset, specify the number of minutes to add during summer time. The default is 60.

1-120 minutes

Command Mode

Global Config

Default

Summer time should be disabled by default.

Usage

The first part of the clock summer-time Global Config 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

This example shows how to specify that summer time starts on june 1st at 0200 and ends on the October 31 at 0200:

Switch# configure terminal
Switch(config)# clock set summer-time stime recurring 6 1 02:00:00 10 31 02:00:00 
120

This example shows how to specify that summer time starts on March the second Wednesday at 0200 and ends on the August the last Friday at 0100:

Switch# configure terminal
Switch(config)# clock set summer-time stime recurring second Wed 3
02:0:0 last Fri 8 01:0:0 60

Related Commands

show clock (detail)

2.9.4. show clock

Command Purpose

Use this command to display the current time and date configuration.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show clock ( detail | )

Parameter

Parameter Description

Parameter Value

detail

Display the configured timezone and summer time information in addition to current date and time

-

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

This example displays current time and date in detail:

Switch#show clock detail

10:43:00 Europe/+3 Fri Oct 25 2023
Time zone: (GMT + 03:00:00) Europe/+3

Related Commands

show clock

2.9.5. show timezones

Command Purpose

Use this command to display all the timezones in world.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show timezons

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

This example displays all the current timezones:

Switch#show timezones

(GMT+00:06:04) Europe/Andorra
(GMT+03:41:12) Asia/Dubai
(GMT+04:36:48) Asia/Kabul
(GMT-04:07:12) America/Antigua
(GMT-04:12:16) America/Anguilla
(GMT+01:19:20) Europe/Tirane
(GMT+02:58:00) Asia/Yerevan
(GMT-04:36:00) America/Curacao
(GMT+00:52:56) Africa/Luanda
(GMT+11:06:24) Antarctica/McMurdo McMurdo Station, Ross Island
============================================================
(GMT+00:00:00) Antarctica/South_Pole Amundsen-Scott Station, South Pole
(GMT-04:32:32) Antarctica/Rothera Rothera Station, Adelaide Island
(GMT-04:16:24) Antarctica/Palmer Palmer Station, Anvers Island

Related Commands

show clock