Time
Configuring time zone
sudo timedatectl set-timezone <your_time_zone>
Replace the timezone in
/etc/timezone
file:echo <your_time_zone> | sudo tee /etc/timezone
Change the system timezone:
sudo dpkg-reconfigure --frontend noninteractive tzdata
Update time using HTTP
htpdate -s www.google.com
date -s "$(wget -S "http://www.google.com/" 2>&1 | grep -E '^[[:space:]]*[dD]ate:' | sed 's/^[[:space:]]*[dD]ate:[[:space:]]*//' | head -1l | awk '{print $1, $3, $2, $5 ,"GMT", $4 }' | sed 's/,//')"
Last updated