4 ways to change your time zone in Linux

Table of contents:

4 ways to change your time zone in Linux
4 ways to change your time zone in Linux
Anonim

If you move around the world, you will be able to change the time zone in all Linux distributions by means of a system command, by using a geographic location application in text mode or by using Linux graphical interfaces. Mint, Ubuntu or any other modern distribution.

Steps

Method 1 of 4: Use a command terminal

Change the Timezone in Linux Step 1

Step 1. Open a terminal

You can open a terminal from your computer's GUI by clicking on the black rectangular icon in your taskbar or by simultaneously pressing Ctrl + Alt + T on your keyboard.

Change the Timezone in Linux Step 16

Step 2. Check the time zone of your system

Invoke date in the terminal then press the Enter key on your keyboard. The terminal will display your system date and time as

Day-of-week Date Month Year hour: minutes: seconds (UTC offset)

.

  • You will see displayed Wednesday, October 9, 2019 10:11:23 AM (UTC-0500) for a French computer located in Lima (Peru). The term UTC is the acronym for English Universal Time VSoordinate or Universal Time Coordinate, which is based on the Greenwich Mean Time. The number (UTC -0500) represents a 5 hour time difference west from the Greenwich Meridian.
Change the Timezone in Linux Step 17

Step 3. Check the geographic areas available on your system

Come in

cd / usr / share / zoneinfo in your terminal then press the Enter key on your keyboard. Then type tzselect which you will follow by pressing the Enter key on your keyboard to validate the command. This will display in your terminal the list of geographic areas available on your system.

The exact contents of the / usr / share / zoneinfo directory will depend on the distribution you are using

Change the Timezone in Linux Step 18

Step 4. Choose a continent or an ocean

Choose from the list the number corresponding to the continent where you are located. Enter it after the question mark at the bottom of the list and then press Enter on your keyboard.

Change the Timezone in Linux Step 19

Step 5. Select a country

Choose from the displayed list the number corresponding to the country in which you are located. Type it after the question mark at the bottom of the list and press Enter on your keyboard.

Change the Timezone in Linux Step 20

Step 6. Select a time zone

Choose the number corresponding to the region you are in, type it after the question mark at the bottom of the list and press Enter on your keyboard.

If the city or region you are in is not in the displayed list, choose one that is in the same time zone

Change the Timezone in Linux Step 22

Step 7. Confirm the displayed local time

Confirm that the displayed local time is correct by typing 1 on the prompt line at the bottom of the terminal, then press Enter on your keyboard.

If the time was not displayed correctly, type 2 on the prompt line at the bottom of the terminal, then press Enter on your keyboard and select a new continent. Repeat the process previously described

Change the Timezone in Linux Step 21

Step 8. Check that your settings have been taken into account

Run the date command and check that your time settings match those you just chose. You may consider your settings to be correct if the local time in your location matches the time displayed on your screen.

Change the Timezone in Linux Step 9

Step 9. Synchronize your PC clock with Internet time servers

Most recent distributions of Linux implement NTP server access protocols by default. NTP is the acronym for NOTetwork Time Protocol or Network time synchronization protocol. If yours does not, you will need to install the software packages required to use NTP synchronization. Depending on the distribution of Linux you are using, invoke the following commands:

  • under Ubuntu, Mint and Debian, enter sudo apt install ntpdate;
  • under CentOS, enter sudo yum install ntpdate

    sudo / sbin / chkconfig ntpd on;

  • under Fedora and RedHat, enter sudo yum install ntpdate

    sudo chkconfig ntpd on.

  • After running the install command, enter

    ntpdate server link && hwclock –w to be sure to replace the default link with that of the NTP site.

Method 2 of 4: Use the location menu in text mode

Change the Timezone in Linux Step 15

Step 1. Open a terminal

You can open a terminal from your computer's GUI by clicking on the black rectangular icon in your taskbar or by simultaneously pressing Ctrl + Alt + T on your keyboard.

Change the Timezone in Linux Step 12

Step 2. Enter the command to invoke the time zone menu

It will depend on the distribution you are using:

  • under Ubuntu and Mint, enter sudo dpkg-reconfigure tzdata and then the administration password when prompted;
  • under Redhat, enter redhat-config-date;
  • under CentOS and Fedora, enter system-config-date;
  • under FreeBSD and Slackware, invoke tzselect.
Change the Timezone in Linux Step 13

Step 3. Select the continent where you are located

Use the arrow keys to locate the continent you are in, then press the Enter key on your keyboard.

Change the Timezone in Linux Step 14

Step 4. Select the city or region where you are located

Select a city or a region corresponding to the time zone in which you are located then press the Enter key on your keyboard. This will change the time zone of your system.

Method 3 of 4: Use the Ubuntu GUI

Change the Timezone in Linux Step 14

Step 1. Click the icon

Android7dropdown

from the system menu.

This icon symbolizing an inverted triange is located in the upper right corner of the screen. A drop-down menu will appear.

Change the Timezone in Linux Step 15

Step 2. Click the settings icon

You will find this icon symbolizing a crossed spanner and screwdriver in the lower left corner of the displayed menu. This will have the effect of opening the Ubuntu Control Center.

Change the Timezone in Linux Step 16

Step 3. Scroll down the sidebar and click Details

You will find this button at the bottom of the sidebar which is on the left of the window.

Make sure your mouse cursor is positioned over the left sidebar when you pull it down

Change the Timezone in Linux Step 17

Step 4. Click the Date and Time tab

You will find it on the left side of the window.

Change the Timezone in Linux Step 18

Step 5. Turn off the Automatic Time Zone feature

To do this, click on the blue button labeled Automatic time zone which is in the middle part of the page.

  • If the button labeled Automatic time zone is grayed out, it is already disabled and you can skip this procedure.
Change the Timezone in Linux Step 19

Step 6. Click Time Zone

Clicking on this button at the bottom of the window will open the time zone selection menu.

Change the Timezone in Linux Step 20

Step 7. Choose your time zone

To do this, click on one of the regions of the planisphere that is displayed. You should see the clock change its display to match the time zone you selected.

Change the Timezone in Linux Step 21

Step 8. Close the window

This will save your settings and update your system clock with your selected time zone.

Method 4 of 4: Use the Mint GUI

Change the Timezone in Linux Step 1

Step 1. Open the system boot menu

Click on the Menu in the lower left corner of your screen.

Change the Timezone in Linux Step 2

Step 2. Click on the system settings icon

If you are using version X in your graphical interface, you will find this icon symbolizing a gear made up of two cogwheels among Favorites, on the left of the system menu. If you have chosen to use the version Y of the graphical interface, this icon symbolizes two superimposed switches.

Change the Timezone in Linux Step 3

Step 3. Click the Date and Time button

You will find it in the group of options titled Preferences.

Change the Timezone in Linux Step 4

Step 4. Click Unlock

You will find this button to the right of the dialog.

Change the Timezone in Linux Step 26

Step 5. Enter your Sudo password

When prompted, enter the password with which you usually log into your system.

Change the Timezone in Linux Step 27

Step 6. Click Authenticate

This button is located at the bottom of the identification window. This will unlock the date and time settings menu.

Change the Timezone in Linux Step 5

Step 7. Select a time zone

Click on a city in one of the time zones to change your system time. You will see the clock on the right of the page immediately set to the correct time according to the time zone you have just chosen.

Change the Timezone in Linux Step 29

Step 8. Now click on Lock

This button is located on the right of the window. This will lock the settings menu and save your new date and time settings.

Advice

  • On versions of Linux qualified as standard, such as RedHat Linux, Slackware, Gentoo, SuSE, Debian, Mint, Ubuntu and others, be sure to invoke dated to display and modify the system time and not time which is used to time the execution of an order.
  • On smartphones and other small equipment running Linux, the time zone is recorded in a different way from that applied on desktop computers. This information is written to the file / etc / TZ. You can edit it by hand or by invoking the echo command. To set the time zone to UK you will need to enter echo GMT0BST> / etc / TZ in the terminal.

Warnings

  • Some programming applications like PHP have very different time setting modes than the operating system.
  • On some operating systems, there is a built-in utility that will ask you to enter your time zone and make the appropriate system configuration settings on your own. This is the case for Debian based distributions, like Ubuntu or Mint which provide the utility. tzsetup Where tzconfig.

Popular by topic