Your computer clock drifts because the internal battery that powers it is dying, your system time settings are misconfigured, or your internet connection is preventing automatic updates

A computer clock runs on a coin-cell battery on the motherboard called a CMOS battery. When that battery weakens, the clock loses time and resets to a default date when you power off the machine. If you see your clock jump backward or show a date from years ago after shutdown, the CMOS battery is the culprit. Replacing it costs between $5 and $20 and takes 10 minutes if you are comfortable opening your case.

If your clock drifts slowly forward or backward while the machine is on, the problem is usually that your system is not syncing with a time server. Windows and macOS both have built-in tools to sync your clock automatically over the internet. When that sync fails — because your internet connection is down, your firewall is blocking it, or the service is disabled — your clock will drift at the rate your internal clock chip naturally runs, which is rarely perfect.

Key Takeaways

  • A dying CMOS battery causes your clock to reset to an old date after you shut down; replacing it is cheap and straightforward.
  • Slow drift while the machine is running usually means automatic time sync is disabled or blocked by your network.
  • Windows syncs with time.windows.com and macOS syncs with Apple's time servers; both can be forced to sync manually.
  • If your clock is wrong only in one process, that program may be using a different time source or running in a sandbox with its own clock.
  • A BIOS battery that is failing will also cause other symptoms: random shutdowns, forgotten BIOS settings, and boot failures.

How to check if your CMOS battery is failing

Shut down your computer completely and unplug it for at least five minutes. When you power it back on, check the system clock. If it shows a date from several years ago — often 2000, 2010, or whenever the computer was manufactured — your CMOS battery is dead or dying. This is the most reliable sign.

You can also check your BIOS settings. Restart your computer and enter the BIOS setup menu (usually by pressing Delete, F2, or F12 during startup — the key appears on your boot screen). Look at the system date and time shown there. If it is wrong, the CMOS battery is the problem. If the BIOS time is correct but Windows or macOS shows the wrong time, the issue is in your operating system settings, not the battery.

Replacing the CMOS battery

The CMOS battery is a small coin-cell battery, usually CR2032 or similar, soldered or clipped to the motherboard. To replace it, shut down your computer, unplug the power cable, and open the case. Ground yourself by touching a metal part of the case to avoid static discharge. Locate the battery — it is usually near the BIOS chip and is about the size of a dime.

If the battery is clipped in, gently pry it out with a plastic tool or your fingernail. If it is soldered, you will need a soldering iron or a technician. Buy a replacement CR2032 (or whatever type your motherboard uses) from any pharmacy or electronics store for $3 to $5. Insert it with the positive side facing up, close the case, and power on. Your clock should now hold the correct time after shutdown.

Forcing your system to sync with a time server

On Windows: Open Settings, go to Time & Language, then Date & Time. Toggle "Set time automatically" off, wait 10 seconds, then toggle it back on. Windows will contact time.windows.com and sync when ready. If that does not work, open Command Prompt as Administrator and type w32tm /resync, then press Enter. This forces a manual sync.

On macOS: Open System Settings, go to General, then Date & Time. Uncheck "Set date and time automatically", wait a few seconds, then check it again. macOS will sync with Apple's time servers. If the problem persists, open Terminal and type sntp -sS time.apple.com, then press Enter.

If manual sync fails, your firewall or network may be blocking access to the time server. Check that your internet connection is working and that your firewall allows outbound connections on port 123 (NTP). If you are on a corporate network, ask your IT department whether they have a local time server you should use instead.

Why your clock drifts even when synced

Between syncs, your computer's internal clock chip — called the Real Time Clock or RTC — runs on its own. This chip is not perfectly accurate. It may gain or lose a few seconds per day depending on temperature, age, and manufacturing tolerances. This is normal. As long as your system syncs with a time server regularly, the drift is corrected automatically and you will not notice it.

If you see your clock drifting noticeably — more than a minute per day — and syncing does not fix it, the RTC chip itself may be failing. This is rare on modern hardware but can happen on older machines. If replacing the CMOS battery and forcing a sync do not solve the problem, the motherboard may need replacement.

Clock problems in specific applications

Sometimes only one program shows the wrong time while your system clock is correct. This usually means the process is running in a sandbox or virtual environment with its own clock, or it is reading time from a source other than your system clock. Web browsers sometimes show the wrong time if your system clock is wrong at the moment the page loads — refreshing the page usually fixes it.

If a single process consistently shows the wrong time, try restarting it. If that does not work, check the process's settings for a time zone or clock sync option. Some programs allow you to set a custom time offset. If the problem only happens on one user account, log in as a different user and check whether the clock is correct there — this can point to a corrupted user profile rather than a hardware issue.

Network time protocol and why it matters

Your computer syncs time using the Network Time Protocol, or NTP. This is a standard that allows computers to ask a time server "what time is it?" and adjust their clock accordingly. NTP servers are maintained by universities, government agencies, and technology companies. Your system contacts one of these servers periodically — usually once per day or once per week depending on your operating system.

If your computer cannot reach an NTP server, it will not sync. This can happen if your internet is down, if your router is blocking port 123, or if you are behind a corporate firewall that does not allow NTP. Some networks require you to use a specific local time server instead of the public ones. If you are on a work network and your clock is always wrong, contact your IT department to find out which time server you should use.

Frequently Asked Questions

Why does my clock reset to 2000 when I shut down?

Your CMOS battery is dead. This battery keeps the clock running when your computer is powered off. When it fails, the clock resets to the default date the motherboard was manufactured. Buy a CR2032 battery and replace it — it takes 10 minutes and costs about $5.

My clock is wrong but my internet is working. What do I check next?

Open your system settings and verify that automatic time sync is turned on. If it is already on, try turning it off and back on to force a manual sync. If that does not work, check your firewall settings to make sure port 123 is not blocked. If you are on a work network, ask IT whether they have a local time server you should use.

Can a wrong system clock cause other problems?

Yes. A wrong clock can break SSL certificate validation (making websites appear unsafe), cause email to fail, prevent Windows updates, and confuse backup software about which files are newer. Fixing your clock should be a priority if it is significantly off.

Is it safe to open my computer to replace the CMOS battery?

Yes, if you take basic precautions. Unplug the power cable completely, ground yourself by touching the metal case, and work slowly. The battery itself is not dangerous. If you are uncomfortable opening your case, a computer repair shop can do it for $20 to $50 in labor.

What if my clock is correct in BIOS but wrong in Windows?

Your CMOS battery is fine. The problem is in your operating system. Check that automatic time sync is enabled in your system settings, and verify that your internet connection is working. If sync is on and your internet is up, your firewall may be blocking NTP — check port 123 in your firewall rules.