Adjusting for Daylight Saving Time

Problem

You want the router to automatically adjust to Daylight Saving Time.

Solution

Some areas, such as most of North America and Europe, have consistent and common rules for when to switch between winter or Standard time and summer or Daylight Saving Time. The traditional North American rule, and the default for Cisco routers when they are configured for summer time, is to move an hour ahead at 2:00 AM on the first Sunday in April, and back an hour at 2:00 AM on the last Sunday in October. We note in passing that this rule will change starting in 2007, which we discuss in more detail in Recipe 14.19:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#clock summer-time EDT recurring
Router(config)#end
Router#

You can also specify exact recurrence rules. You could use the following command to explicitly define the North American rules:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#clock summer-time EDT recurring first sun apr 02:00 last sun oct 02:00
Router(config)#end
Router#

You can modify this line to represent other standard recurrence rules. For example, in the Southern Hemisphere, Daylight Saving Time commences towards the end of the year to match their summer season. To define the rules for Australian Eastern Daylight Time (AEDT), you could use the following command:

Router#configure terminal  Enter configuration commands, one per line. End ...

Get Cisco IOS Cookbook, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.