sudo timedatectl set-timezone <your_time_zone>
Replace the timezone in /etc/timezone file:
/etc/timezone
echo <your_time_zone> | sudo tee /etc/timezone
Change the system timezone:
sudo dpkg-reconfigure --frontend noninteractive tzdata
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 6 months ago
Was this helpful?