Showing results for 
Search instead for 
Did you mean: 

IOS & Catalyst time format


I have configured ntp synchronization for all the devices in my network. But I do have some questions regarding the time format:

1. Is there any way to change the time format in my router or switch? Right now it displays the 24 hours time format but I would like to use the 12 hours format.

2. Let's say that I can change the format, if my NTP Public server is sending the 24 hour time format. Will my router be able to display the time in the 12 hours format or it depends on the NTP server's format?

3. I am using VoIP and I would like to syn my Pub from one of the routers. If the router uses the 24 hour format, will the Pub be able to syn to this router even though the computer time is displayed in the 12 hour format?

Thanks for all your help.

Hall of Fame Cisco Employee

Re: IOS & Catalyst time format

The default is to show the clock in 24-hour format. This cannot be changed using the built-in commands. However, you could create a TCL EEM policy (provided your device supports EEM) which could capture the "show clock" command and display the time format however you want. For example, create a directory, flash:/policies to hold your EEM scripts. Then copy a policy script into that directory. The script, clock_pol.tcl would look like:

::cisco::eem::event_register_cli pattern "show clock" sync yes occurs 1

namespace import ::cisco::eem::*

namespace import ::cisco::lib::*

set date [clock format [clock seconds] -format {%I:%M:%S %p %Z %a %b %d %Y}]

puts $date

exit 0

Then, configure it:

event manager directory user policy "flash:/policies"

event manager policy clock_pol.tcl type user

Then every time you run "show clock" you will get something like:

07:45:01 PM EST Sat Dec 01 2007

As for formats and NTP, NTP doesn't worry about how the time is displayed. Time is synced using the number of seconds since the beginning of the epoch. This value is in UTC, and is the same regardless of timezone or time display format.

Stated another way, if your NTP server displays its time in 12-hour format, a host can sync to that server, and display its time in 24-hour format (and vice versa).


Re: IOS & Catalyst time format


Thank you for your response. Another questions: does the same apply for computers?

In other words, I would like to synchronize my callmanger servers using my core L3 switch. This switch displays the time in the 24 hour format but the server uses the 12 hour format. Can this be done?

Thanks again.

Hall of Fame Cisco Employee

Re: IOS & Catalyst time format

Yes, this can be done. Displaying the time has nothing to do with how NTP sends updates. The NTP updates will ALWAYS be in UTC.

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards