WSL2 date time skew error

WSL2 has had issues with the guest clock falling behind real time after the computer is suspended. This causes errors with build systems (including GNU Make and Ninja) and SSL verification among others.

A simple workaround when this occurs is to restart the WSL VM from Windows Terminal, PowerShell, or Command Prompt:

wsl --shutdown

If the distro is still running with the wrong time, try synchronizing the guest clock from inside WSL. On some distros hwclock may be unavailable or ineffective inside WSL2, but when it works:

hwclock -s

If that doesn’t work, try NTP from WSL Terminal. Depending on distro, you may need to install ntpdate first:

ntpdate time.windows.com

This issue has been noted at WSL GitHub Issues:

Other issues are linked from those