cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
120150
Views
0
Helpful
3
Replies

how to set clock on switch? (hardware calendar)

ohalnet53
Level 1
Level 1

hi mates :)

anybody knows if I can set the clock based on hardware calendar? Please see how I tried and failed:

switch#show clock detail

*05:00:29.823 UTC Sat Jun 17 2006

Time source is hardware calendar.

unfortunately the time switch shows is wrong (One hour faster). I tried to fix it with the command:

switch#clock set 04:00:00 17 Jun 2006

switch#copy running-config startup-config

switch#show clock

04:01:01.507 UTC Sat Jun 17 2006

Time source is user configuration.

it worked until I re-started the switch. After the re-start, it showed the wrong time again (One hour faster again).

Is there any way to fix it and get the correct time even after re-start th switch?

thanks for help :)

3 Replies 3

glen.grant
VIP Alumni
VIP Alumni

The quick answer is no , it will always be wrong after unless you use a ntp server .

vladrac-ccna
Level 5
Level 5

Are you looking for this:

Setting the Software Clock from the Hardware Clock

http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/ffun_c/fcfprt3/fcf012.htm#wp1001584

Anyway , as the last post the best is to configure a NTP

http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/ffun_c/fcfprt3/fcf012.htm#wp1001170

HTH,

if it does please rate this post.

vlad

I will agree that the best way to set the clock is via NTP. However, it is desireable and possible to update the hardware clock (when there is one). If there is a network failure, and your router or switch reboots, you will still want your time rightly set.

Use the command

clock update-calendar

to set the hardware clock from the software clock.

Check

http://www.cisco.com/en/US/products/sw/iosswrel/ps5187/products_command_reference_chapter09186a008017d031.html#wp1068428

Use the command

ntp update-calendar

to periodically update the hardware clock from ntp

Check http://www.cisco.com/en/US/products/sw/iosswrel/ps5187/products_command_reference_chapter09186a008017d034.html#wp1060033

Use the command

calendar set

to manually set the hardware clock

Check http://www.cisco.com/en/US/products/sw/iosswrel/ps5187/products_command_reference_chapter09186a008017d030.html#wp1031609

Note that not all Cisco routers and switches have hardware clock that keeps time.