Sub topic 15
Time Drift and Clock Synchronization
This chapter assumes you can use an elevated Command Prompt or PowerShell, know the difference between a local account and a domain account, and understand that the BIOS/UEFI holds a hardware clock. It covers why a Windows clock goes wrong, how to confirm the cause, and how to fix it with the least disruption. Time problems carry low weight on the A+ exam, but they often hide inside questions about certificates, sign-in failures, or a battery.
Why the clock matters
Windows uses the system time for more than the taskbar display. Many security features compare timestamps, so a clock that is wrong by a few minutes can look like a different fault.
- Kerberos authentication on an Active Directory domain rejects tickets when the client and domain controller differ by more than five minutes by default. The user sees sign-in failures or "trust relationship" style errors.
- HTTPS certificates have start and end dates. A wrong clock makes a valid site show a certificate warning.
- Log correlation breaks. Event Viewer entries from two machines will not line up.
- Scheduled tasks, backups, and update checks run at the wrong moment or not at all.
- File timestamps become misleading, which can confuse sync tools.
Time drift means the clock gradually moves away from the correct time. A sudden large jump, such as the date resetting to 2000 or 2015, points to a different cause.
Where Windows gets its time
Two clocks are involved.
- The hardware clock (real-time clock, RTC) runs on the motherboard, powered by a small CMOS battery when the PC is off. Firmware setup (BIOS/UEFI) shows and sets this clock.
- The system clock is kept by Windows while it runs. At startup Windows reads the RTC, then the Windows Time service (
W32Time) corrects it against a time source.
The time source depends on how the PC is joined.
| Computer type | Default time source |
|---|---|
| Domain-joined workstation | The domain hierarchy, ending at the domain controller that holds the PDC emulator role |
| Standalone or workgroup PC | An internet NTP server, `time.windows.com` by default |
| Virtual machine | Often the host through an integration service, plus or instead of NTP |
NTP (Network Time Protocol) is the standard protocol for this exchange. It uses UDP port 123. A firewall that blocks that port stops synchronization.
Common causes and matching symptoms
| Symptom | Likely cause | First fix |
|---|---|---|
| Clock resets to a default date after every power-off | Dead or weak CMOS battery | Replace the CR2032 battery, then reset the time |
| Clock is wrong by exactly some whole hours | Wrong time zone, or daylight saving setting | Correct the time zone in Settings |
| Clock slowly runs fast or slow | Infrequent sync, unreliable source, unstable RTC | Resync and confirm the source |
| Sync fails with an error | `W32Time` stopped, or UDP 123 blocked | Start the service, check the firewall |
| Domain PC cannot sign in, other PCs can | Clock more than five minutes off the domain controller | Resync to the domain |
| Dual-boot PC is off by the UTC offset after switching OS | Windows and Linux interpret the RTC differently | Configure one OS to match the other |
| Certificate errors on many sites at once | Wrong date | Fix the date first, then retest |
The exam often points to the CMOS battery. If the time is wrong only after the computer has been unplugged or powered off, and Windows keeps correct time while running, suspect the battery. Resyncing in Windows will not help, because the next power-off loses it again.
Diagnosing the problem
Follow the CompTIA methodology: identify the problem, test a theory, then act.
Check the current state
Open an elevated prompt and query the service status.
w32tm /query /status
w32tm /resyncThe first command shows the time source, the last successful sync time, and the stratum, which is the distance from the reference clock. A source of Local CMOS Clock means the PC is not syncing to anything and is trusting its own hardware clock. The second command asks the Windows Time service to resynchronize immediately.
Common results of w32tm /resync:
- "The command completed successfully." The sync worked. If the clock was wrong, the cause was drift or an earlier failure.
- "The computer did not resync because the required time change was too big." The difference exceeds a safety limit. Set the time manually closer, then resync.
- "The service has not been started."
W32Timeis stopped. Start it.
Confirm the service
The Windows Time service should be running. On many standalone PCs it is set to Manual (Trigger Start), so it may be stopped between syncs and that is normal. If it is disabled, sync cannot run.
Get-Service w32time
Start-Service w32time
Set-Service w32time -StartupType AutomaticStart with the first command. Run the others only if the service is stopped or disabled.
Check settings
In Settings, open Time & language > Date & time. Confirm that Set time automatically and Set time zone automatically match what you intend. For a domain PC, time zone must still be correct, because the domain syncs UTC and each client converts it to local time.
Fixing the problem
Choose the least destructive option that fits the cause.
- Wrong time zone. Change the time zone. Do not edit the time to compensate, because that breaks UTC-based features.
- Sync failed once. Run
w32tm /resync. - Service stopped or disabled. Start it and set a suitable startup type.
- Blocked network. Confirm the PC has working internet or domain connectivity. A PC with limited connectivity cannot reach an NTP server. Check that the firewall allows outbound UDP 123.
- Dead CMOS battery. Power off, replace the coin cell, enter firmware setup, and set the date and time. Then let Windows sync.
- Domain mismatch. Resync to the domain controller. Do not set the clock by hand on a domain PC, because the next sync will undo it.
Changing the time source is a deliberate configuration step, not a first-line fix. On a standalone PC you can pick a different server under Date & time > Additional clocks > Internet Time, in the Control Panel's Date and Time dialog.
Dual-boot and virtual machines
Windows stores local time in the RTC by default. Many Linux systems store UTC. When you switch between them, the clock is off by the UTC offset. The exam rarely asks for the fix, but you should recognize the pattern: the offset is whole hours and appears only after booting the other OS.
A virtual machine can drift when it is paused or restored from a snapshot, because the guest does not see the elapsed time. Resyncing with the host integration service or w32tm /resync corrects it.
Time drift versus other problems
A clock error can mimic or cause other faults, so check time early when symptoms involve authentication or certificates.
- If a domain user cannot sign in but a local account works, check the clock before resetting the password.
- If a browser warns about every secure site, check the date before suspecting malware or a bad certificate.
- If the clock changes by itself after you correct it, a Group Policy or domain sync is overriding your manual change, or malware is altering it. Look at the time source and recent software changes.
Exam strategy
Match the pattern to the answer.
- Time resets after power-off: replace the CMOS battery.
- Whole-hour error: fix the time zone.
- Domain sign-in fails for one PC: resync with the domain.
- Certificate warnings on all sites: correct the date and time.
Choose the cheapest fix that addresses the stated cause. Resyncing is cheaper than reinstalling, and a battery replacement is the answer only when the clock loses time while powered off.
Exercise
A technician finds that a laptop shows the correct time while Windows is running, but the date resets to January 1 every morning after the laptop has been shut down overnight. Running w32tm /resync fixes the time each day. What is the most likely permanent fix, and why does resyncing not solve it?
Show answer
Replace the CMOS battery. The hardware clock loses its value when the laptop is powered off, so Windows starts with a wrong time each day. Resyncing corrects only the running system clock and does not stop the hardware clock from losing its setting.
Exercise
A user on a domain-joined PC cannot sign in with domain credentials, but coworkers can. The PC's clock is eight minutes ahead of the domain controller. Which command should you run from an elevated prompt, and why is the difference significant?
Show answer
Run w32tm /resync. Kerberos allows a clock difference of only five minutes by default, so an eight-minute gap causes ticket validation to fail and blocks the sign-in.