How To Change TimeZone on openSUSE
In this tutorial, we will show you how to change TimeZone on openSUSE. Setting the correct timezone on Linux servers is essential for accurate system logs, proper execution of cron jobs that rely on the system time, and consistency across services. openSUSE makes it easy to configure the system timezone from the command line without needing to use graphical tools.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step change to TimeZone on openSUSE.
Prerequisites
- A server running one of the following operating systems: openSUSE.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- You will need access to the terminal to execute commands. openSUSE provides the Terminal application for this purpose. It can be found in your Applications menu.
- You’ll need an active internet connection.
- You’ll need administrative (root) access or a user account with sudo privileges.
Change TimeZone on openSUSE
Step 1. Check the Current time zone.
To verify the current timezone set for the system, use the timedatectl status
command:
timedatectl status
This will print out details like:
Time zone: Europe/Amsterdam (CET, +0100)
Take note of the current setting before making changes.
Step 2. Change the Timezone on openSUSE.
To set a new timezone, use the timedatectl set-timezone
command as root or with sudo:
sudo timedatectl set-timezone America/New_York
Replace America/New_York
with the timezone you want to use.
openSUSE recognizes the IANA timezone database, which follows the Region/Location naming convention. Some examples include:
Timezone | Description | Offset from UTC |
---|---|---|
America/New_York | Eastern Time | UTC-5 |
Europe/London | Greenwich Mean Time | UTC+0 |
Asia/Tokyo | Japan Standard Time | UTC+9 |
To see the full list of available timezones for your system, use:
timedatectl list-timezones
The output can be filtered to make searching easier:
timedatectl list-timezones | grep Tokyo
Step 3. Verify Timezone Change.
Check that the new timezone was configured correctly with:
timedatectl status
The output should show the updated time zone. You can also use the date
command to print the current date and time to double-check.
Step 4. Configure Hardware Clock Settings.
It is important to configure the hardware clock properly for timezone changes to persist reboots:
- Check Hardware Clock
Use timedatectl
to see if the hardware clock is set to UTC or local time:
timedatectl
Look for the RTC in local TZ
line.
- Set the Hardware Clock to UTC
For systems that dual boot with Windows, it is best to set the hardware clock to UTC:
timedatectl set-local-rtc 0
The hardware clock will now be synchronized to UTC instead of local time.
Step 5. Troubleshooting Tips.
If you encounter issues when changing the time zone, here are some troubleshooting tips:
- Ensure that the timezone you’re trying to set is valid. You can refer to the tz database for a list of valid time zones.
- If you’re using openSUSE and the changes aren’t persisting, ensure that you’re not overriding the timezone with a shell environment variable.
- If the
timedatectl
command isn’t working as expected, check if the NTP service is active. If it is, you may need to disable it.
Congratulations! You have successfully changed TimeZone. Thanks for using this tutorial to change TimeZone on your openSUSE system. For additional or useful information, we recommend you check the official openSUSE website.