You can execute the steps given below using root or sudo users to change the timezone on Ubuntu 18.04 server.
1. Check your current time zone by executing the following commands.
2. The picture above shows that the current timezone is UTC; this can be changed.
3. We want to change the timezone, so first, we need to list all the zones; you can check it by executing this command –
# timedatectl list-timezones
4. You can see the list of time zones.
Now, if we wish to change the timezone to ‘Africa/Juba.”
Now, we will grep ‘Juba’ from the timezone by executing the command given below –
# timedatectl list-timezones | grep Juba
5. Finally, we have identified our timezone; let’s change it to Africa/Juba.
Follow the below-given command to change the timezone.
# timedatectl set-timezone Africa/Juba
6. We can see that our timezone has changed by performing the above command.