Skip to content

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

Diagram

Classes

configuration (iosxe.devices)

NameTypeConstraintMandatoryDefault Value
clockClass[clock]No

clock (iosxe.devices.configuration)

NameTypeConstraintMandatoryDefault Value
calendar_validBooleantrue, falseNo
summer_timeClass[summer_time]No
timezoneStringNo
timezone_offset_hoursIntegermin: -23, max: 23No
timezone_offset_minutesIntegermin: 0, max: 59No

summer_time (iosxe.devices.configuration.clock)

NameTypeConstraintMandatoryDefault Value
zoneStringNo
dateClass[date]No
recurringClass[recurring]No

date (iosxe.devices.configuration.clock.summer_time)

NameTypeConstraintMandatoryDefault Value
enabledBooleantrue, falseNo
start_dayIntegermin: 1, max: 31No
start_monthChoiceJan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, DecNo
start_yearIntegermin: 1993, max: 2035No
start_timeStringNo
end_dayIntegermin: 1, max: 31No
end_monthChoiceJan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, DecNo
end_yearIntegermin: 1993, max: 2035No
end_timeStringNo
offsetIntegermin: 1, max: 1440No

recurring (iosxe.devices.configuration.clock.summer_time)

NameTypeConstraintMandatoryDefault Value
enabledBooleantrue, falseNo
start_weekIntegerNo
start_weekdayChoiceSun, Mon, Tue, Wed, Thu, Fri, SatNo
start_monthChoiceJan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, DecNo
start_timeStringNo
end_weekIntegerNo
end_weekdayChoiceSun, Mon, Tue, Wed, Thu, Fri, SatNo
end_monthChoiceJan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, DecNo
end_timeStringNo
offsetIntegermin: 1, max: 1440No

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:

Terminal window
clock summer-time EST date Jan 1 2000 8:00 Jan 1 2001 7:59
clock calendar-valid

Here is the breakdown of the following configuration:

Terminal window
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.

Terminal window
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