Unable to change date and time settings in Ubuntu 16.04 using command line
You can use timedatectl
, it does all the necessary things for you itself.
First make sure NTP is not enabled:
sudo timedatectl set-ntp 0
then set the time:
sudo timedatectl set-time "2017-05-30 18:17:16"
make sure your timezone is correct too, e.g:
sudo timedatectl set-timezone Europe/Paris
and also use UTC if you are using localtime:
sudo timedatectl set-local-rtc 0