Shami's Blog

Sysadmin, Because Even Developers Need Heroes

Update system time with HTTP

2023-08-21

The other day I needed to update the time on a server that didn’t have access to any NTP servers. It was a server located in a locked down network with only HTTP/HTTPS access to the internet. I found the following command that allowed me to update the time/date through HTTP

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

About Me

Dev gone Ops gone DevOps. Any views expressed on this blog are mine alone and do not necessarily reflect the views of my employer.

twitter linkedin