Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

when it asks for your location. If you move or just want to change the settings
(for example, to have your computer automatically synchronize its clock with
official time servers on the Internet), you can do so.


Changing the Time and Date

Using Ubuntu’s graphical tool is the simplest way to set your system date and
time and the most obvious for a desktop user. From the Settings window
select Details and then select Date & Time to make changes. You can
manually set the date and time in the GUI or have your computer obtain
updated date and time information via the Internet.


Using the date Command

Use the date command to display or set your Linux system time. This
command requires you to use a specific sequence of numbers to represent the
desired date and time. To see your Linux system’s idea of the current date and
time, use the date command like this:


Click here to view code image
matthew@seymour:~$ date
Fri Sep 28 18:03:14 CDT 2018


To adjust your system’s time (for example, to September 28, 2018 at 10:33
a.m.), use a command line with the month, day, hour, minute, and year, like
so:


Click here to view code image
matthew@seymour:~$ sudo date 092810332018
Fri Sep 28 18:03:14 CDT 2018


Using the hwclock Command

Use the hwclock command to display or set your Linux system time,
display or set your PC’s hardware clock, or synchronize the system and
hardware times. To see your hardware time and date, use hwclock with the
—show option, like so:


Click here to view code image
matthew@seymour:~$ sudo hwclock --show
Fri 28 Sep 2018 06:04:43 PM CDT -0.281699 seconds


Use hwclock with its —set and —date options to manually set the
hardware clock, as follows:

Free download pdf