linux change date code example
Example 1: linux set date timezone
# To view timezone
timedatectl
# list all available timezones
timedatectl list-timezones
# update timezone
sudo timedatectl set-timezone your_time_zone
Example 2: change date linux
date --set="YYYYMMDD HH:MM:SS"
Example 3: how to mannually change date and time in linux
date -s "19 APR 2012 11:14:00"
Example 4: debian change time command line
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
sudo hwclock --systohc