7

I can't seem to get the terminal command 'date' working. Here is an example of the commands I gave in terminal:

$ date
Wed Oct  7 17:17:38 EDT 2015
$ sudo date --set="20151007 18:17:00"
Wed Oct  7 18:17:00 EDT 2015
$ date
Wed Oct  7 17:18:11 EDT 2015

Is there something I need to change in the settings to be able to manually set the time? I've looking into disabling ntp but as far as I can tell it isn't something that needs to be disabled to be able to manually set time.

I've looked up all the possible formats of the date string, and none of them did the trick. Here are some of the ones I tried:

$ sudo date --set="2 OCT 2006 18:00:00"
$ sudo date +%Y%m%d -s "20081128"
$ sudo date 120622432007.55
$ sudo date --set="Sat Oct 10 10:10:10 EDT 2015"

I would appreciate any help. Thanks.

  • 2
    Are you possible running ntpd which resets your time to the one synchronized with a remote server? – nKn Oct 8 '15 at 16:16
14

It turns out I had to change time/date settings from automatic to manual in System Settings. As I am doing everything through ssh I could not do this in the gui settings, but the equivalent command on terminal is:

$ timedatectl set-ntp false

This disables the automatic time sync allowing me to set the time and date manually using the date command

  • If @nKn re-phrases the suggestion into an official answer, it would be right for GeneralAsh to accept that answer so nKn gets proper reputation benefit. After all, nKn really did provide the right direction to look at. – TOOGAM Oct 8 '15 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.