How can I change the date and time on Ubuntu?

Solution 1:

From man date

-s, --set=STRING
          set time described by STRING

To change date, use the command in terminal,

sudo date --set=STRING

For example, to change date to 25 Sep 2013 15:00, the command would be,

sudo date --set "25 Sep 2013 15:00:00"

Solution 2:

Try this:

sudo dpkg-reconfigure tzdata

This 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

Solution 3:

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.

enter image description here

enter image description here

Solution 4:

See this blog post for setting the date with a machine-friendly format string:

sudo date 120622432007.55

for 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"

Solution 5:

If you want to change the time zone only, refer to this:

  • How to change timezone on Ubuntu 18.04 Bionic Beaver Linux

Therefore

  1. Check Current Timezone Settings: $ timedatectl
  2. Show all Available Timezones: $ timedatectl list-timezones
  3. Change Timezone: $ sudo timedatectl set-timezone Europe/Berlin.