How can I change the date and time on Ubuntu?
When I go to change the date and time it doesn't work. I try to unlock but it just won't unlock. If there is any way to make it work please help.
I know it isn't very descriptive but I really would appreciate some answers.
16 Answers
From man date
-s, --set=STRING set time described by STRINGTo change date, use the command in terminal,
sudo date --set=STRINGFor example, to change date to 25 Sep 2013 15:00, the command would be,
sudo date --set "25 Sep 2013 15:00:00" 10 Try this:
sudo dpkg-reconfigure tzdataThis both lets you configure your timezone (you may just pick the same), and automagically synchronizes your time.
If there's no tzdata package, install it:
sudo apt-get update
sudo apt-get install tzdata 1 In 12.04 I don't have to Unlock anything. Just click on the clock on the top bar, and choose Time & Date Settings, once the Time & Date window opens, choose Manually, so you can change the time and date manually; otherwise choose your time zone from the map, and choose Automatic.
See this blog post for setting the date with a machine-friendly format string:
sudo date 120622432007.55for December 6, 2007, 22:43:55,
and see this answer for setting the date with a human-friendly string:
sudo date --set "15 MAY 2011 1:40 PM" 1 If you want to change the time zone only, refer to this:
Therefore
- Check Current Timezone Settings:
$ timedatectl - Show all Available Timezones:
$ timedatectl list-timezones - Change Timezone:
$ sudo timedatectl set-timezone Europe/Berlin.
I had similar issue on my install and the above command gave this error:
date: the argument '19 Sep 2014 20:11:00' lacks a leading '+';
when using an option to specify date(s), any non-option
argument must be a format string beginning with '+'
Try 'date --help'Help shows -
Usage: date [option]... [+FORMAT] - (etc)Added the required plus as indicated to render +19 Sep 2014 20:11:00 which worked.