Clock
Clock configuration manages system time settings on network devices, including timezone specification, daylight saving time adjustments, and calendar validation parameters. Accurate timekeeping is critical for network operations including log correlation, certificate validation, time-based access controls, and synchronization with external time sources. The clock configuration works in conjunction with NTP (Network Time Protocol) to maintain precise time across the network infrastructure, supporting both fixed date ranges and recurring seasonal time changes.
Diagram
Classes
configuration (iosxe.devices)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
clock | Class | [clock] | No |
clock (iosxe.devices.configuration)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
calendar_valid | Boolean | true , false | No | |
summer_time | Class | [summer_time] | No | |
timezone | String | No | ||
timezone_offset_hours | Integer | min: -23 , max: 23 | No | |
timezone_offset_minutes | Integer | min: 0 , max: 59 | No |
summer_time (iosxe.devices.configuration.clock)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
zone | String | No | ||
date | Class | [date] | No | |
recurring | Class | [recurring] | No |
date (iosxe.devices.configuration.clock.summer_time)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
enabled | Boolean | true , false | No | |
start_day | Integer | min: 1 , max: 31 | No | |
start_month | Choice | Jan , Feb , Mar , Apr , May , Jun , Jul , Aug , Sep , Oct , Nov , Dec | No | |
start_year | Integer | min: 1993 , max: 2035 | No | |
start_time | String | No | ||
end_day | Integer | min: 1 , max: 31 | No | |
end_month | Choice | Jan , Feb , Mar , Apr , May , Jun , Jul , Aug , Sep , Oct , Nov , Dec | No | |
end_year | Integer | min: 1993 , max: 2035 | No | |
end_time | String | No | ||
offset | Integer | min: 1 , max: 1440 | No |
recurring (iosxe.devices.configuration.clock.summer_time)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
enabled | Boolean | true , false | No | |
start_week | Integer | No | ||
start_weekday | Choice | Sun , Mon , Tue , Wed , Thu , Fri , Sat | No | |
start_month | Choice | Jan , Feb , Mar , Apr , May , Jun , Jul , Aug , Sep , Oct , Nov , Dec | No | |
start_time | String | No | ||
end_week | Integer | No | ||
end_weekday | Choice | Sun , Mon , Tue , Wed , Thu , Fri , Sat | No | |
end_month | Choice | Jan , Feb , Mar , Apr , May , Jun , Jul , Aug , Sep , Oct , Nov , Dec | No | |
end_time | String | No | ||
offset | Integer | min: 1 , max: 1440 | No |
Clock Configuration for Cisco IOS XE Devices
Overview:
This document provides a concise guide to configuring the “Clock” feature on Cisco IOS XE devices, focusing on system time and Daylight Saving Time (DST) settings. Proper time configuration is vital for network operations, logging, and security.
Key Configuration Elements:
clock
Block
The primary block for time management.
clock
Parameters:
calendar_valid
: A boolean indicating if the hardware calendar is considered valid for timekeeping.timezone
: The timezone name (e.g.,EST
,PST
).timezone_offset_hours
: The timezone offset in hours from UTC (range: -23 to 23).timezone_offset_minutes
: The timezone offset in minutes from UTC (range: 0 to 59).
summer_time
Block
Defines Daylight Saving Time (DST) rules using either fixed dates or recurring rules.
summer_time
Parameters:
zone
: Specifies the name of the daylight saving time zone (e.g.,EST
).date
: A nested object for defining DST based on fixed dates.enabled
: A boolean flag to enable fixed-date DST configuration.start_day
: The day of the month when DST starts (e.g.,1
).start_month
: The month when DST starts (e.g.,Jan
).start_year
: The year when DST starts (e.g.,2000
).start_time
: The time of day when DST starts, in HH:MM format (e.g.,"00:00"
).end_day
: The day of the month when DST ends (e.g.,31
).end_month
: The month when DST ends (e.g.,Dec
).end_year
: The year when DST ends (e.g.,2000
).end_time
: The time of day when DST ends, in HH:MM format (e.g.,"23:59"
).offset
: The offset in minutes applied during DST (e.g.,60
for one hour forward).
recurring
: A nested object for defining DST based on recurring rules (e.g., “first Sunday in March”).enabled
: A boolean flag to enable recurring DST configuration.start_week
: The week of the month when recurring DST starts (e.g.,1
for the first week).start_weekday
: The weekday when recurring DST starts (e.g.,Mon
).start_month
: The month when recurring DST starts (e.g.,Jan
).start_time
: The time of day when recurring DST starts, in HH:MM format (e.g.,"00:00"
).end_week
: The week of the month when recurring DST ends (e.g.,2
for the second week).end_weekday
: The weekday when recurring DST ends (e.g.,Fri
).end_month
: The month when recurring DST ends (e.g.,Dec
).end_time
: The time of day when recurring DST ends, in HH:MM format (e.g.,"23:59"
).offset
: The offset in minutes applied during recurring DST (e.g.,60
for one hour forward).
Sample Configuration:
clock summer-time EST date Jan 1 2000 8:00 Jan 1 2001 7:59clock calendar-valid
Here is the breakdown of the following configuration:
clock summer-time EST date Jan 1 2000 8:00 Jan 1 2001 7:59
This command sets a fixed, one-time Daylight Saving Time (DST) period for the EST zone, starting January 1, 2000, at 8:00 AM and ending January 1, 2001, at 7:59 AM, typically with a 60-minute offset.
clock calendar-valid
This command tells the device to trust its internal hardware clock (RTC) as a valid time source, especially if no other time synchronization (like NTP) is available or after a reboot.
Example Code:
iosxe: devices: - name: Device1 configuration: clock: calendar_valid: true timezone: EST timezone_offset_hours: -5 timezone_offset_minutes: 0 summer_time: zone: EDT date: enabled: true start_day: 1 start_month: Jan start_year: 2000 start_time: "00:00" end_day: 31 end_month: Dec end_year: 2000 end_time: "23:59" offset: 60 recurring: enabled: true start_week: 1 start_weekday: Mon start_month: Jan start_time: "00:00" end_week: 2 end_weekday: Fri end_month: Dec end_time: "23:59" offset: 60