Cisco: How to set clock time, date, time zone, daylight savings change, and NTP for MDS switches
Summary: How to set clock time, date, time zone, daylight savings change, and NTP for MDS switches.
Instructions
Set time zone:
config clock timezone zone-name offset-hours offset-minutes
Example to set the eastern time zone: (The eastern time zone is UTC -5, no minutes of offset)
config clock timezone EST -5 0
Set daylight savings time: Set the dates when the clock changes ahead and behind an hour, must change this manually every year as the dates change.
config clock timezone timezone_name hour_offset_from_UTC minute_offset_from_UTC
Example for eastern daylight savings time:( setting the time zone, start week, day, month, time/ end week, day, month time/ offset in minutes)
This command sets daylight savings time to start the first week of march, Sunday, at 2 am and ends the first week of November on Sunday at 2 am. It sets the time forward 60 minutes on the start date, and back 60 minutes on the end date.
config clock summer-time EDT 1 Sunday March 02:00 1 Sunday November 02:00 60
Set clock time: Sets time, day, month, year
clock set {HH:MM:SS DD Month-in-words YYYY}
Example
clock set 12:00:00 3 December 2017
If the ntp feature is enabled, you cannot set the clock. Disable ntp (no ntp enable or no feature ntp). Then set the clock. Then enable NTP again.
Configure NTP: Check if the clock time is set within 10 minutes of time or the ntp may not sync properly.
config
Ntp enable
ExampleNtp server 192.168.1.1 <--- sets the ntp server (required, can set multiple peers as well)Ntp peer 10.1.1.1 <--- sets a peer switch that is using ntp or another ntp server (not required)
To manually attempt ntp sync to clock, run the command:Ntp sync-retry