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.
clock set [hh:mm:ss] [day] [month] [year]When to Use This Command
- Setting the correct time on a router in a lab or isolated network without NTP servers.
- Synchronizing the router's clock to a known accurate time before enabling logging or debugging to ensure timestamps are meaningful.
- Correcting the time after a power outage or when the router has been offline and the clock has drifted.
- Setting the clock during initial router setup before configuring NTP as a fallback.
Command Examples
Set clock to a specific date and time
clock set 14:30:00 15 March 2025No output is displayed on success. The command silently sets the clock. Use 'show clock' to verify.
Set clock with incorrect format (missing seconds)
clock set 14:30 15 March 2025% Incomplete command.
The command requires the full hh:mm:ss format. Omitting seconds results in an error.
Understanding the Output
The 'clock set' command produces no output on success. To verify the clock, use 'show clock'. The 'show clock' output displays the current time, timezone, and whether the clock is authoritative. A properly set clock shows the correct time and date. If the clock is not set, it may show '*00:00:00 UTC Mon Mar 1 1993' or similar. In production, ensure the clock is accurate for logging and routing protocols like OSPF that rely on timestamps.
CCNA Exam Tips
CCNA exam tip: The 'clock set' command is only available in privileged EXEC mode (enable), not global configuration mode.
CCNA exam tip: The time format is 24-hour (hh:mm:ss). The day is numeric, month is spelled out (e.g., March), and year is four digits.
CCNA exam tip: If you see '% Incomplete command', you likely omitted a required parameter like seconds or month.
CCNA exam tip: After setting the clock, always verify with 'show clock' to ensure the change took effect.
Common Mistakes
Mistake 1: Using the command in global configuration mode instead of privileged EXEC mode. Consequence: 'Invalid input detected' error.
Mistake 2: Forgetting to include seconds (hh:mm instead of hh:mm:ss). Consequence: '% Incomplete command' error.
Mistake 3: Using an incorrect month abbreviation or numeric month. Consequence: 'Invalid input detected' error.
Related Commands
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 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.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions