Phones and operating systems

"Your clock is behind" or "ahead": SSL errors from wrong time

By · Last verified

Error messageYour clock is behind

When your device's clock is wrong, valid certificates look expired or not yet valid, so every HTTPS site fails. Chrome recognises the situation and shows "Your clock is behind" or "Your clock is ahead"; other browsers show their normal certificate warning. The fix is on the device: set the correct date, time and time zone, and turn on automatic sync.

Is it the site or your device?

If every HTTPS site fails at once, it is almost certainly your device. To confirm a single site is fine, check it with the SSL checker:

curl ssl.sh/example.com

If the checker shows a valid certificate and your device's date differs from the real date, the clock is the cause. Do not click through the warnings; fixing the time removes them all.

Causes

1. Automatic time turned off

On phones and laptops, automatic time may have been switched off to change a game timer or test something. Turn it back on.

2. Dead CMOS battery

Desktop PCs that show a date like 2001 or the BIOS build date after a power cut have a dead motherboard battery. Replace it.

3. Wrong time zone

Time is correct for the wrong zone, so the absolute time is off by hours. Certificates issued in the last few hours may then appear not yet valid.

4. Virtual machines and dual boot

VMs restored from snapshots resume with old time; dual-boot systems may disagree about whether the hardware clock stores local time or UTC. Enable guest time sync, or configure both systems consistently.

5. Blocked time synchronisation

Firewalls that block NTP (UDP port 123) prevent automatic correction. Use the network's internal time server if it has one.

What it looks like on each device

Device What you see
Chrome / Edge "Your clock is behind" or "Your clock is ahead", with NET::ERR_CERT_DATE_INVALID
Firefox SEC_ERROR_EXPIRED_CERTIFICATE or MOZILLA_PKIX_ERROR_NOT_YET_VALID_CERTIFICATE, with your device's date shown
Safari / iPhone "This Connection Is Not Private" on every site
Apps Login failures, "certificate not yet valid" or generic network errors

How to fix the clock

Turn on automatic date, time and time zone; only the menu path differs by system.

Windows 10/11: Settings > Time & language > Date & time > turn on "Set time automatically" and "Set time zone automatically", then "Sync now". From an elevated prompt:

w32tm /resync

macOS: System Settings > General > Date & Time > enable "Set time and date automatically".

iPhone / iPad: Settings > General > Date & Time > "Set Automatically".

Android: Settings > System > Date & time > "Automatic date & time" (menu names vary by manufacturer).

Linux: check and enable sync:

timedatectl status
sudo timedatectl set-ntp true

How site owners fix it

Nothing is wrong with the site when the clock is at fault. Site owners can help users by keeping certificates valid with a margin (renew well before expiry, see the validity calculator) and by telling support staff to check the user's clock when errors appear on every site.

FAQ

My clock is right but Chrome still says it is behind. Why?

Check the time zone as well as the time: a correct local time with the wrong time zone is still the wrong absolute time. Also make sure the date, not only the hour, is correct. If everything matches, the certificate may be expired; test with curl ssl.sh/example.com.

Why does my PC lose the time after every restart?

The small battery on the motherboard (CMOS/RTC battery) is likely dead, so the clock resets when power is removed. Replace the battery; until then, automatic time sync will correct it shortly after boot.

Can a wrong clock cause other security problems?

Yes. Besides HTTPS errors, a wrong clock breaks two-factor codes, software updates, Kerberos sign-in on company networks and log timestamps.

Sources

  1. Mozilla Support: How to troubleshoot time related errors on secure websites
  2. Google Chrome Help: Fix connection errors
  3. RFC 5280 section 4.1.2.5: Validity