Set the date and time in CentOS 8

s2 0

It is very important that your installed operating system has the correct date and time settings, as many programs running in the background (corn jobs) are executed at certain times and also log entries contain time stamps so that in the event of system events an error can be traced. And of course, when working on the desktop, the clock should also show the correct time 🙂

In this tutorial we will show you how to set the date and time in CentOS 8 via the GUI and also via the shell (command line).

Set the date and time via the graphical user interface

Step 1. Log into your system and click on “Activities” located in the top left corner of the desktop under CentOS 8.

Step 2. You will see the few icons on the desktop. Click the Settings icon in this window.

Step 3. A window will appear on the screen. Click on the search icon available in the top left corner of the viewing screen.

Settings search

Step 4. Enter “date and time” in the search bar. In response to your search, relevant results are displayed in the current window.

Date and time settings

Step 5. Click this option. Another screen will appear on the system. Click the Date and Time as highlighted in the following image.

Change the date and time

Step 6. An interface will now appear on the system in which the “+” sign increases the time and “-” decreases it. You can adjust the time according to your time zone. The day and year can also be adjusted in a similar way using the ‘+’ and ‘-‘ signs.

Appointment time

In the “Month” section there is a drop-down menu from which you can select the desired month.

Choose month

Step 7. You can also adjust the time zone by clicking “Time Zone” in the current window.

Change time zone

Enter the name of the desired city in your region in the search bar. The time zone is automatically adjusted after this action.

Select the time zone on the map

You can also customize the time format you want to set it to as 24 hour or AM / PM format. You can customize it from the drop-down menu.

Set time format

Change the date and time with the CentOS terminal

With the command ‘timedatectl’ we can set the time of the system clock. You can also use the timedatectl command to change the date and time zone.

The following steps are required to set the date and time via the terminal:

Step 1. Open the terminal window with the key combinations ‘Ctrl + Alt + t’.

CentOS terminal

Step 2. To display the date and time already set on your system, enter the following command:

$ timedatectl status

Time datl

Step 3. To check the current time zone of your operating system, write the following command:

$ timedatectl

To check all available time zones in your system, write the following command on the terminal:

$ timedatectl list-timezones

List time zones

Step 4. To change the time of your operating system, enter the following command:

$ timedatectl set-time 16:19:00

$ timedatectl

The time is adjusted with the command ‘timedatectl set-time’. The correct format is HH: MM: SS, where HH: hours MM: minutes are SS: seconds. You can customize it accordingly.

Change system time

Step 5. To adjust the date, write the following command on the terminal:

$ timedatectl set-time 2019-12-12

$ timedatectl

The date is set with the command ‘timedatectl set-time’. The format for adjusting the required date is YY: MM: DD where YY: year MM: month DD: date. You can adjust the date accordingly.

Change system date

Step 6. You can set the date and time at the same time. To do this, write the following command.

$ timedatectl set-time '2019-12-12 16:18:45'

$ timedatectl

The format is available in YY-MM-DD HH: MM: SS. You can adjust the time and date as you wish.

Change the date and time in one go

diploma

In this article you learned how to set the time and date on CentOS 8. I hope you find this article useful. Now you can change the date and time of your Linux system. If you have any problems, you can share your problem through comments.

Set the date and time in CentOS 8