Close

Sync date without NTP (for BeagleBone, Pi, etc)

Kumar, AbhishekKumar, Abhishek wrote 01/18/2016 at 19:34 • 1 min read • Like

I live in a place protected by a HTTP Proxy, so NTP doesn't work when I want to sync date for my SBCs as they don't keep the time when turned off.

I found this command, which can be used to set the date by querying a Google server. Not so accurate as NTP but does the job.

sudo date -s "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')"

Like

Discussions

Yann Guidon / YGDES wrote 07/07/2016 at 09:48 point

That's definitely a hack.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 07/07/2016 at 09:56 point

(and a security nightmare)

  Are you sure? yes | no