The show time command on a Cisco switch displays the current system time and date as set in the device's internal clock. This output includes the day of the week, month, day, hour, minute, second, and year. It is used to confirm the accuracy of the switch's time settings, which affects log entries, SNMP traps, and time-based access control.
When executed in privileged EXEC mode, the command returns a single line of formatted output. For example:
Switch# show time
Current time: 16:43:22 UTC Tue Mar 12 2024
This shows the switch is set to 4:43 PM UTC on Tuesday, March 12, 2024. The time zone (UTC) and format depend on configuration. If the switch lacks NTP synchronization, the time may drift over days.
Time accuracy is critical for network operations. A mismatched clock can cause confusion during incident investigations. For example, a security alert logged at "14:30" may appear out of sequence if the switch's clock is off by four hours. The show time command is the first step in validating time integrity.
The show time command retrieves data from the switch's internal Real-Time Clock (RTC), which is powered by a backup battery. If the battery fails, the clock resets to a default value upon reboot. The RTC does not automatically sync with internet time sources unless Network Time Protocol (NTP) is configured.
When a switch boots, it initializes the RTC using the last known time stored in non-volatile memory. If no prior setting exists, it defaults to January 1, 2000, 00:00:00. After boot, administrators must manually set the correct time or configure NTP to maintain accuracy.
Administrators often run show time during troubleshooting sessions to check whether log timestamps align with actual events. For instance, if a port flapped at 15:12:04 and the switch's time shows 14:12:04, the discrepancy suggests a misconfigured clock.
The show time command is part of the Cisco IOS command-line interface (CLI). It is available on most enterprise-grade switches, including the Catalyst 2960, 3560, and 9300 series. It is not supported on older models like the 2900 series without an upgraded IOS version.
There are no distinct "types" of show time. However, output varies based on configuration:
clock timezone and clock summer-time.For example, a switch in New York configured with clock timezone EST -5 and clock summer-time EDT 2 0 14:00 will display local time with automatic DST shifts. Running show time during daylight saving will show EDT (UTC-4), while outside DST it shows EST (UTC-5).
Network engineers use show time during routine maintenance, incident response, and audit preparation. It ensures logs from multiple devices can be correlated across a network.
Consider a scenario where a firewall logs a denial event at 10:05:12 AM, but a switch's show logging output shows the same event at 11:05:12 AM. Running show time on both devices reveals the switch is one hour behind. Correcting the time on the switch synchronizes the timeline.
Time synchronization is mandatory in regulated environments. The National Institute of Standards and Technology (NIST) recommends that all network devices maintain time within ±1 second of UTC. show time is used to validate compliance with such standards.
Many users assume show time displays the time from the management station or a remote server. It does not. It shows only the switch's local clock. Even if the switch is connected to an NTP server, show time reflects the local time until the switch updates via NTP.
A common mistake is assuming that setting the time via clock set automatically enables NTP. That is false. The clock set command sets the local time, but NTP must be separately configured with ntp server and ntp authenticate for ongoing synchronization.
Another error: mistaking the output format. The command shows time in 24-hour format. A value like "16:43:22" means 4:43 PM, not 4:43 AM. Misreading this leads to incorrect troubleshooting assumptions.
The show time command does not update the system clock. It only reports the current value. To change the time, use clock set (e.g., clock set 14:30:00 12 Mar 2024). The show time command remains unchanged until the new time is applied.
I once encountered a support ticket where a client reported inconsistent timestamps across switches. After running show time on each device, I discovered one switch had a corrupted RTC due to a failed backup battery. Replacing the hardware restored time accuracy. The command revealed the issue without requiring packet captures or complex analysis.
| Command | What It Shows | Use Case |
|---|---|---|
show time |
Current system time and date | Verify local clock accuracy |
show clock |
Same as show time |
Legacy alternative; functionally identical |
show ntp status |
NTP peer status and offset | Determine if time is synchronized with a server |
show logging |
Log messages with timestamps | Correlate events across devices |
While show clock is functionally equivalent to show time, show time is preferred in newer IOS versions for clarity. Both return the same output.
Always verify time settings on new or recovered switches. Run show time after configuration changes. Set the time zone correctly using clock timezone and enable NTP with a trusted server.
For example, to set the time zone to Pacific Standard Time and sync with NTP:
Switch(config)# clock timezone PST -8
Switch(config)# ntp server 192.168.1.100 prefer
Switch(config)# exit
Switch# show time
After this, show time should reflect the correct local time and match the NTP server.
When auditing, compare show time outputs across all network devices. A variance greater than 10 seconds between devices indicates a configuration gap that must be resolved.
Understanding the show time cisco switch command is essential for maintaining operational integrity. Accurate time ensures logs are meaningful, alerts are timely, and compliance checks pass.