How to change the system timezone in Ubuntu
Introduction:
On Ubuntu, the system’s timezone is set during the installation, but it can be easily changed at a later time. Using the correct time zone is important for many system-related tasks and processes.
Prerequisite:
1. Server root login credentials.
Step 1:
Log in to your Ubuntu server as a user with sudo privileges. You can use SSH or directly access the server.
$ ssh root@Ip |
Step 2:
Gives the below commands to check the timezone.
$ timedatectl |
Step 3:
To check for available timezones on your server and select anyone for your needs.
$ timedatectl list-timezones |
Step 4:
Search for your time zone from the list of available time zones and select your timezone, it will show whether it has one or not.
$ timedatectl list-timezones | grep -i Asia/Singapore |
Step 5:
Set a new time zone using the below commands.
$ sudo timedatectl set-timezone Asia/Singapore |
step 6:
First, we need to unlink the currently used time zone.
$ sudo unlink /etc/localtime |
Step 7:
And we need to set the new link time zone.
$ sudo ln -s /usr/share/zoneinfo/Asia/Singapore /etc/localtime |
Step 8:
Check whether the time zone has changed or not.
$ timedatectl |
Conclusion
Following the steps mentioned above, we can change the system time zone in Ubuntu.