Why does my computer clock keep going wrong?
Several distinct causes produce the same symptom, and they are distinguishable by how the clock is wrong.
If it loses time only when switched off, or resets to a date decades ago, the CMOS battery has failed. This is a small coin cell on the motherboard powering the real-time clock and BIOS settings while the machine is unpowered. They last years and then stop. Symptoms include the BIOS reporting settings lost, boot order resetting, and — commonly — websites refusing to load with certificate errors, because certificate validity is checked against the system date. Replacement is cheap and usually straightforward.
If it drifts gradually by minutes, time synchronisation is failing. Computers keep time with an inexpensive crystal oscillator that drifts measurably. Systems correct this by contacting a time server using NTP — but synchronisation can be blocked by a firewall, pointed at an unreachable server, or have the service disabled. Check the time settings and force a sync manually.
If it is exactly one hour out, the time zone or daylight saving setting is wrong, or the region does not observe DST as configured.
If it is exactly some whole number of hours out on a dual-boot machine, this is a well-known conflict. Windows treats the hardware clock as local time; Linux and macOS treat it as UTC. Each corrects the other's setting on boot, so the clock shifts every time you switch. The fix is configuring one of them to match — usually setting Linux to use local time, or Windows to use UTC via a registry change.
If it is wrong in a virtual machine, host suspension and resumption commonly disrupts guest timekeeping; guest additions or tools usually resolve it.
Why accuracy matters beyond convenience: certificate validation, two-factor authentication codes, scheduled tasks, log correlation and file synchronisation all depend on it, and a wrong clock produces confusing failures far from the apparent cause.