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 ?
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.
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,
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...
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide