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

> A wrong date or time makes every HTTPS site fail with certificate errors. How to fix the clock on Windows, macOS, iPhone and Android, and why it happens.

Source: https://ssl.sh/errors/wrong-system-clock-ssl-error/
Last updated: 2026-11-10

**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](https://ssl.sh/tools/ssl-checker/):

```bash
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](https://ssl.sh/errors/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:

```powershell
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:

```bash
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](https://ssl.sh/tools/validity-calculator/)) and by telling support staff to check the user's clock when errors appear on every site.
