show clock
Displays the current system date, time, timezone, and whether the time is synchronized via NTP or manually set, used to verify system time accuracy for logging, authentication, and scheduled tasks.
Definition: show clock is a Cisco IOS privileged exec command. Displays the current system date, time, timezone, and whether the time is synchronized via NTP or manually set, used to verify system time accuracy for logging, authentication, and scheduled tasks.
Overview
The `show clock` command is a fundamental yet critical diagnostic tool in Cisco IOS that displays the current system date, time, timezone, and time source (NTP or manual). Accurate timekeeping is essential for network operations: it timestamps syslog messages for forensic analysis, ensures Kerberos authentication validity, synchronizes SNMP traps, and schedules recurring tasks like interface resets or configuration backups. Without a reliable clock, troubleshooting becomes guesswork—correlating events across devices becomes impossible, and security mechanisms like digital certificates may fail.
The command operates in Privileged EXEC mode (enable) and requires no special privileges beyond basic access. It reads the system calendar, which can be set manually via `clock set` or synchronized via Network Time Protocol (NTP). The output includes the current time in 12-hour or 24-hour format (depending on locale), timezone abbreviation, and an asterisk (*) if the time is not authoritative (e.g., NTP not synchronized).
A plus (+) indicates the time is authoritative. The command is non-disruptive and does not affect the running configuration. In a broader workflow, you would use `show clock` before deploying time-sensitive configurations (like NTP associations) to verify baseline time, after configuring NTP to confirm synchronization, or during troubleshooting when logs show inconsistent timestamps.
Alternatives include `show ntp status` for detailed NTP peer information, but `show clock` is the quickest health check. Important IOS behavior: the clock is not saved in the running configuration; it is maintained in the hardware calendar (if present) or software. On routers with a hardware calendar, the `clock calendar-valid` command indicates reliability.
The command also appears in `show tech-support` output for comprehensive diagnostics. For CCNA/CCNP candidates, mastering `show clock` is foundational for understanding system time dependencies in routing protocols (e.g., OSPF timers), AAA authentication, and log correlation.
show clockWhen to Use This Command
- Verify NTP synchronization after configuring an NTP server to ensure accurate timestamps in logs.
- Check system time before troubleshooting time-sensitive protocols like OSPF or EIGRP that require time synchronization.
- Confirm manual time setting after a router reboot when NTP is not available.
- Audit time drift by comparing system time with an external reference during maintenance.
Command Examples
Basic show clock output with NTP sync
show clock*14:25:30.123 UTC Mon Mar 4 2024
The asterisk (*) indicates the time is authoritative (synchronized via NTP or manually set). '14:25:30.123' is the current time in HH:MM:SS.mmm format. 'UTC' is the timezone. 'Mon Mar 4 2024' is the day, date, and year.
show clock with no NTP sync
show clock14:25:30.123 UTC Mon Mar 4 2024
No asterisk means the time is not synchronized (no NTP or manually set without authority). The time may be inaccurate. Same fields as above but without the leading asterisk.
Understanding the Output
The output shows the current system time in 24-hour format with milliseconds. The leading asterisk (*) indicates the time source is considered reliable (NTP synchronized or manually set with the 'clock set' command). Without the asterisk, the time is not authoritative and may drift.
The timezone is displayed (e.g., UTC, EST). The day of week, month, day, and year are shown. In a real network, a missing asterisk could indicate NTP failure, leading to log timestamp inaccuracies and potential authentication issues (e.g., OSPF MD5 keys).
Always ensure the asterisk is present for production devices.
Configuration Scenarios
Verify NTP Synchronization After Configuration
After configuring NTP on a router to synchronize with a time server, you need to confirm the clock is accurate and synchronized. This ensures logs and authentication have correct timestamps.
Topology
R1(Gi0/0)---10.0.12.0/30---(Gi0/0)NTP-Server (192.168.1.10)Steps
- 1.Step 1: Enter privileged EXEC mode: R1> enable
- 2.Step 2: Display the current clock: R1# show clock
- 3.Step 3: Check for an asterisk (*) after the time, which indicates the time is not synchronized (e.g., 12:34:56.789 UTC Mon Mar 1 1993 *). If synchronized, you'll see no asterisk or a plus (+).
- 4.Step 4: If not synchronized, verify NTP associations: R1# show ntp associations
- 5.Step 5: Check NTP status: R1# show ntp status
! NTP configuration example R1(config)# ntp server 192.168.1.10 R1(config)# end
Verify: R1# show clock 12:45:30.123 UTC Mon Mar 15 2025 (No asterisk indicates synchronization)
Watch out: A common mistake is forgetting to set the timezone with `clock timezone` before NTP synchronization. NTP adjusts UTC only; if timezone is not set, local time will be off.
Manually Set Clock for Lab or Non-NTP Environment
In a lab or isolated network without NTP, you need to manually set the system clock to a known time for testing time-based features like ACLs or logging.
Topology
Single router R1 with no external connectivitySteps
- 1.Step 1: Enter privileged EXEC mode: R1> enable
- 2.Step 2: Set the clock: R1# clock set 14:30:00 15 March 2025
- 3.Step 3: Verify the setting: R1# show clock
- 4.Step 4: If the router has a hardware calendar, update it: R1# clock update-calendar
! Manual clock setting R1# clock set 14:30:00 15 March 2025 R1# clock update-calendar
Verify: R1# show clock 14:30:00.000 UTC Sun Mar 15 2025 * (The asterisk indicates the time is not authoritative, which is expected in a non-NTP environment.)
Watch out: If you set the clock but do not update the hardware calendar, the time may revert after a reload. Always use `clock update-calendar` to save to hardware.
Troubleshooting with This Command
When troubleshooting time-related issues, `show clock` is the first command to run. Healthy output shows the correct date/time with no asterisk (or a plus) and the correct timezone. Problem indicators include: an asterisk (*) after the time, which means the clock is not synchronized (e.g., NTP unreachable or not configured); a year far in the past (e.g., 1993) indicating the calendar was reset; or a timezone mismatch causing log timestamps to appear off by hours.
Focus on the time source field: if it says 'NTP' but shows an asterisk, NTP is configured but not synchronized. Common symptoms this command helps diagnose include: syslog messages with timestamps that don't match real-world events (e.g., all logs show the same time), authentication failures (Kerberos tickets expired), or routing protocol adjacencies flapping due to time drift (OSPF uses time for LSA aging). A step-by-step diagnostic flow: 1) Run `show clock` to see current time and synchronization status. 2) If unsynchronized, check NTP reachability with `show ntp associations` and `show ntp status`. 3) Verify network connectivity to NTP server using `ping`. 4) Check for ACLs blocking NTP (UDP port 123). 5) If manual clock is set, confirm hardware calendar with `show calendar`. 6) Correlate with `show logging` to see if timestamps align.
For deeper analysis, combine with `debug ntp events` (caution: CPU-intensive) to see NTP packet exchanges. On devices with multiple VDCs or VRFs, ensure you are checking the correct context. Also, remember that `show clock` displays the software clock; the hardware calendar may differ—use `show calendar` to compare.
In summary, `show clock` is the quickest health check for time synchronization, and its output guides further troubleshooting steps.
CCNA Exam Tips
CCNA exam tip: The asterisk (*) in 'show clock' output indicates the time is authoritative (NTP synchronized or manually set with 'clock set').
CCNA exam tip: If the asterisk is missing, the time is not synchronized; this can cause OSPF neighbor issues if authentication is used.
CCNA exam tip: 'show clock detail' provides additional info like time source (NTP, calendar, user) and last update.
CCNA exam tip: NTP synchronization is required for accurate logging and some routing protocols; know how to verify with 'show ntp status'.
Common Mistakes
Mistake 1: Assuming the time is accurate without checking for the asterisk; consequence: log timestamps may be wrong, causing troubleshooting confusion.
Mistake 2: Confusing 'show clock' with 'show calendar'; the calendar is a separate hardware clock that may differ from the system clock.
Mistake 3: Forgetting to set the timezone correctly; consequence: logs show incorrect local time even if NTP is synced.
show clock vs show ntp status
Both show clock and show ntp status provide time-related information, but they serve different purposes. show clock displays the actual system time and date, while show ntp status shows the NTP synchronization state and parameters. They are often used together to diagnose time accuracy issues.
| Aspect | show clock | show ntp status |
|---|---|---|
| Scope | Current system time and date | NTP synchronization status and stratum |
| Configuration mode | Privileged EXEC | Privileged EXEC |
| Persistence | Reflects time at that instant | Reflects current NTP state |
| Precedence | Shows time regardless of NTP | Shows NTP sync even if time is set manually |
| Typical use | Verifying system time for logs | Troubleshooting NTP synchronization |
Use show clock when you need to quickly check the current system time or verify that the time is correct for logging and authentication.
Use show ntp status when you need to verify that NTP is synchronized, check the stratum level, or troubleshoot NTP-related time issues.
Platform Notes
In IOS-XE (e.g., Catalyst 9000 switches), the `show clock` command syntax and output are identical to classic IOS. However, IOS-XE may display additional fields like 'Time source is NTP' explicitly. On NX-OS (e.g., Nexus switches), the equivalent command is `show clock` as well, but the output format differs slightly: it shows the time in a more verbose format and includes the timezone offset.
For example: '15:30:00.000 UTC Sun Mar 15 2025'. NX-OS also supports `show ntp peers` for detailed NTP info. On ASA firewalls, the command is `show clock` and works similarly, but the timezone configuration is done via `clock timezone` in global config mode.
In IOS-XR (e.g., ASR 9000), the command is `show clock` but the output includes the timezone and synchronization status. Note that IOS-XR uses a different NTP configuration model (e.g., `ntp server` under the appropriate VRF). Between IOS versions, there are minor differences: in older IOS 12.x, the output might not show the time source; in 15.x and later, it always shows.
Also, the asterisk behavior is consistent across versions. For CCNA/CCNP, the command is universal, but be aware of these platform nuances when working in multi-vendor environments.
Related Commands
clock set [hh:mm:ss] [day] [month] [year]
Sets the system clock on a Cisco IOS device from the privileged EXEC mode, used to manually configure the router's time when NTP is not available.
ntp server [ip]
Configures the router to synchronize its system clock with an NTP server, ensuring accurate time for logging, authentication, and network protocols.
show ntp status
Displays the current NTP synchronization status, including clock stratum, reference clock, and synchronization state, used to verify NTP operation and clock accuracy.
Practice for the CCNA 200-301
Test your knowledge with practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions