Why is my computer showing the wrong time, and why does that break websites?
A clock that is out by minutes breaks sign-ins; a clock that is out by years breaks the whole web. The causes in order of likelihood, including the one that means a small part inside the machine has died.
- Difficulty
- beginner
- Time
- 20 min
- Read
- 5 min
Short answer
Turn automatic time and automatic time zone on first — Settings, Time and language on Windows, or System Settings, General, Date and Time on a Mac — and let it sync. If the clock is right while the machine runs but wrong again after every shutdown, the small battery on the motherboard that keeps time while the power is off has gone flat, and no setting will fix that.
The clock feels cosmetic and is not. Secure connections depend on certificates that are valid between two dates, so a machine that thinks it is a year in the future will reject perfectly good certificates and refuse to load most of the web. Two-factor codes are generated from the current time and stop matching if the clock drifts by more than about half a minute. Sign-ins to Microsoft and Google accounts fail. Encrypted email fails. All of this presents as "the internet is broken", and almost nobody looks at the corner of their own screen. It is one of the highest-value two-minute checks in computing.
Step by step
- Look at the date as well as the time.A wrong time by an hour is a time zone or daylight saving problem. A wrong time by minutes is drift. A wrong year is a firmware battery or a reset, and it is the version that breaks everything.
- Turn on automatic time and automatic time zone.On Windows, Settings, Time and language, Date and time, and there is a Sync now button as well. On a Mac, System Settings, General, Date and Time, set date and time automatically. Both use internet time servers and both are the right answer for a home machine.
- Check the time zone separately from the time.These are two different settings and the automatic time zone relies on location services. A machine that shows the right time in the wrong zone, or vice versa, will keep correcting itself back to wrong. Set the zone explicitly if you travel with the machine.
- Force a sync and watch whether it holds.Sync manually, then shut down fully, wait a few minutes, and start up again. A clock that is correct after that is fine. A clock that reverts to a date in the past — often the manufacturing date of the board — has lost its battery-backed timekeeping.
- Replace the coin cell if it is a desktop.The motherboard holds a CR2032 coin cell that keeps the clock and firmware settings while unplugged. They last years and then stop. Replacing one on a desktop is a two-minute job with the machine unplugged; on a laptop it is usually an internal part and a repair-shop job.
- Suspect a second operating system if you dual boot.Windows stores local time in the hardware clock and Linux stores universal time, so a machine with both will appear to jump by the time zone offset every time you switch. Setting one of them to match the other's convention fixes it permanently.
- Check the time server if sync itself fails.Some networks block the time protocol, and a corporate or hotel network may run its own server. Windows lets you pick a different time server in the old Control Panel date and time settings, which is worth trying if syncing consistently fails on one network.
- Fix the clock before troubleshooting anything it broke.Certificate errors, failed sign-ins and rejected two-factor codes will not clear until the time is right, and every minute spent on them before then is wasted.
Common mistakes
- Clicking through certificate warnings instead of checking the clock — Those warnings are the main defence against a fake site, and training yourself to dismiss them is a genuine risk. When every site is warning at once, the clock is far more likely than a coordinated attack.
- Setting the time by hand and turning sync off — It will drift again, and you will have removed the mechanism that would have fixed it. Manual setting is a diagnostic step, not a solution.
- Assuming a wrong clock is harmless — It breaks secure connections, sign-ins, two-factor codes, file timestamps and backup schedules. It is one of the few settings where being slightly wrong causes disproportionate trouble.
If it doesn't work
Out by exactly one hour
Cause: Daylight saving or time zone — Fix: Check the time zone and the automatic daylight saving setting. A machine set to a fixed zone that does not observe British Summer Time will be an hour out for half the year.
Resets to an old date at every start-up
Cause: Flat motherboard coin cell — Fix: Replace it. Expect the firmware to have forgotten its other settings too, including boot order — which is why this fault often arrives alongside a machine that will not boot.
Drifts by a few minutes over weeks
Cause: Normal drift with automatic sync switched off — Fix: Turn automatic time on. A machine's own clock is not accurate over long periods and was never meant to be.
Browsers say every certificate is invalid or not yet valid
Cause: The clock is far enough out that certificates fall outside their validity window — Fix: Correct the clock and every one of those errors disappears at once. "Not yet valid" specifically means the machine thinks it is in the past.
Two-factor codes are always rejected
Cause: Clock drift on the device generating the codes — Fix: Time-based codes tolerate only a small window. Sync the clock on the phone or computer that generates them — authenticator apps often have their own time-correction setting.
Time jumps every time you switch operating systems
Cause: Dual-boot hardware clock convention mismatch — Fix: Set both systems to interpret the hardware clock the same way. Setting Linux to use local time is usually the simpler of the two changes.
Questions people ask
Why does the wrong time stop websites loading?
Secure sites prove their identity with a certificate that is valid only between two dates. Your computer checks that against its own clock. If the clock says 2019 or 2031, the certificate looks expired or not yet issued, and the browser refuses the connection — correctly, because it has no way to tell a wrong clock from a forged certificate.
My phone shows the right time but my computer does not
Phones sync their clock from the mobile network as well as the internet, so they are far more reliably right. That makes the phone a useful reference, and a discrepancy between the two is a strong hint that the computer is the one at fault.
How do I know if the coin cell has gone?
The clock resets when the machine is unplugged or fully off for a while, and the firmware forgets its settings too — boot order, fan profiles, security options. If the time comes back wrong after a weekend away but stays right while the machine is running, that is the diagnosis.
Does this affect file timestamps?
Yes. Files created while the clock was wrong carry the wrong date, and that is not corrected retrospectively. It matters for backup software deciding what has changed, for sorting by date, and occasionally for cloud sync deciding which copy is newer.