cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Bookmark
|
Subscribe
|
473
Views
0
Helpful
3
Replies

clock command (global vs exec)

mohammed hashim
Level 1
Level 1

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 ?

3 Replies 3

Charles Hill
VIP Alumni
VIP Alumni

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.

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,

 

 

"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...