clock command (global vs exec)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2015 09:57 AM - edited 03-07-2019 11:10 PM
hi all,
clock command is available in both global and exec modes ,
I am confused about the difference ,
can someone please clarify it with me ?
- Labels:
-
Other Switching

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2015 10:09 AM
Hello Mohammed,
#clock command in global configuration mode sets the timezone and daylight savingt time settings.
(config)clock command in exec mode sets the actual time.
Hope this helps,
if so, please rate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2015 01:26 PM
clock command in global mode still not clear,
for example if you configure it like:
R1(config)#clock timezone ABC 4
what will happen then ?
assume you have configured clock in exec mode to be exactly your local time,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2015 03:03 PM
"assume you have configured clock in exec mode to be exactly your local time"
That would be fine, until daylight savings time, at which point you would need to manually change the clock on all your switches and routers.
If you set the clock in exec mode first, then set the timezone, time would change depending on the timezone that was set, which would require re configuring the time.
Correct steps in setting time would be:
-> configure the correct time zone. (example: Router(config)# clock timezone CST -6)
-> configure device to adjust time for daylight saving time. (example: Router(config)# clock summer-time CDT recurring)
-> Set the devices's clock in exec mode. (example: Router# clock set 18:00:00 Oct 26 2014)
A couple of benefits of setting the correct time are: Log files display the correct time stamp(if service timestamps is applied to log), using the kron scheduler to schedule commands to be ran at a specific time.
Hope this helps...
