WSL date and time out of sync

Problem

WSL data/time is out of sync with Windows or the actual time.

Solution 1

Run below command in WSL terminal:

sudo hwclock -s

Solution 2

Sometimes, the above solution doesn't work.
Then go the hard way.

sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"

HIH
~ RD

Helpful?

If you think this is helpful 🎈
Don't keep it to yourself 🙊

Share it with your lovely followers at twitter 🗽

lets connect viatwitter