This WikiHow article will guide you through changing the time zone on a Linux computer. You can change the time zone on any Linux distribution with the command line or command line options window. If you're using Mint, Ubuntu, or another distribution with a simple interface, you can change the time zone with a graphical interface.
Step
Method 1 of 4: Using the Command Line
Step 1. Open Terminal
Select the Terminal program from the list of programs, or press Ctrl+Alt+T on the keyboard.
Step 2. Check your current time zone by entering the date command into the Terminal window
After that, press Enter. The terminal will display the date in the format
Day Month Date Time Time Zone Year
-
For example, you will see output like
Wed Mar 7 07:38:23 EDT 2017
- . Here, "EDT" is the current time zone (Eastern Daylight Time).
Step 3. Check the available time zones
Enter the command cd /usr/share/zoneinfo and press Enter. After that, enter the command tzselect and press Enter to display a list of locations.
The /usr/share/zoneinfo directory may differ depending on the Linux distribution you are using
Step 4. Select a continent or region
Enter the number that corresponds to your general location, then press Enter.
Step 5. Select a country
Enter a number from the list provided, then press Enter.
Step 6. Select a time zone
Enter a number to select the time zone, then press Enter.
If your city is not on the list, select a city that has the same time zone
Step 7. Confirm the local time in the next command
If the time is correct, enter "1", and press Enter.
If the time is not correct, enter 2 and press Enter. Repeat the time zone selection process starting from the continent
Step 8. Make sure the time zone is set
Run the date command again, and make sure the time zone matches the selected time zone. If you see the selected time zone, you have successfully changed the time zone.
Step 9. Set the clock to always be in sync with the internet time server if desired
Most modern Linux distributions provide NTP packages by default. If the distribution you are using does not include the NTP package, you will have to install it manually. Use the following command according to your Linux distribution:
- Ubuntu/Mint/Debian: sudo apt install ntp
-
CentOS: sudo yum install ntp
sudo /sbin/chkconfig ntpd on
-
Fedora/RedHat: sudo yum install ntp
sudo chkconfig ntpd on
- Enter the command ntpdate link to server && hwclock –w after installation of the NTP package. Replace "link to server" with the address of your NTP server.
Method 2 of 4: Using the Time Zone Selection Menu
Step 1. Open Terminal
Select the Terminal program from the list of programs, or press Ctrl+Alt+T on the keyboard.
Step 2. Enter the command to change the timezone according to the distribution you are using:
- Ubuntu and Mint - sudo dpkg-reconfigure tzdata followed by administrator or user password.
- Redhat - redhat-config-date
- CentOS and Fedora - system-config-date
- ' FreeBSD and Slackware - tzselect
Step 3. Select a geographic area
Use the arrow keys to select the geographic area of your country, and then press Enter.
Step 4. Select the city or country according to your time zone, then press Enter
Your system time zone will change.
Method 3 of 4: Using the Graphical Interface on Ubuntu
Step 1. Click the system menu icon
This icon is a downward-facing triangle, and can be found in the upper-right corner of the screen. A drop-down menu will appear.
Step 2. Click the screwdriver and cog-shaped "Settings" icon in the top-left corner of the menu
The Ubuntu Control Center will open.
Step 3. Scroll down and click Details at the bottom of the left toolbar of the screen
Make sure your mouse is on the left toolbar when swiping
Step 4. Click the Date & Time tab on the left side of the window
Step 5. Disable the automatic time zone feature by clicking the "Automatic Time Zone" button in the middle of the page
If the "Automatic Time Zone" button is blue, skip this step
Step 6. Click the Time Zone button near the bottom of the window
The time zone selection menu will appear.
Step 7. Select a time zone by clicking on your location on the map
The computer time will change according to the time zone you selected.
Step 8. Close the window to save the settings and update the time zone
Method 4 of 4: Using the Graphical Interface in Mint
Step 1. Click Menu in the lower left corner of the screen
Step 2. Click the gray two screwdriver icon to open system settings
This icon is to the left of the Menu window.
Step 3. Click Date & Time in the "Preferences" group
Step 4. Click Unlock on the left side of the window
Step 5. Enter the user password if prompted
This password is used to log into the computer.
Step 6. Click the Authenticate button at the bottom of the dialog box to open the Date & Time menu
Step 7. Select a time zone
Click the vertical slice on the map to select a time zone. You will see the hour change on the right side of the page, according to the changes you made.
Step 8. Click Lock on the right side of the window
The time zone settings will be saved, and the time menu will be locked.
Tips
- In some versions of RedHat Linux, Slackware, Gentoo, SuSE, Debian, Ubuntu, and other "normal" Linux distributions, the command to display and change the time zone is "date", not "clock".
- On phones and other small devices running Linux, the time zone is stored differently. The timezone file is stored in /etc/TZ, in the format described at [https://docs.sun.com/source/816-5523-10/appf.htm. Edit the file manually or use the "echo" command (eg echo GMT0BST > /etc/TZ to change the timezone to UK).
Warning
- Some applications, such as PHP, have their own time zone that is different from the system time zone.
- On some systems, you can use a system program that will request the correct time zone and change the time zone according to your changes. For example, Debian provides the program "tzsetup" or "tzconfig."