This comprehensive Linux guide expects that you run the following commands as root user but if you decide to run the commands as a different user then ensure that the user has
sudo
access and that you precede each of the privileged commands withsudo
A time zone is nothing but a region of the globe that observes a uniform standard time for constitutional, business and cultural purposes. Using the correct timezone is important for many systems related tasks and processes. Sometimes we forgot to set timezone properly for newly installed system or sometimes we need to change timezone of systems for various testing.
Before changing the timezone of your system, you should first check the current timezone of your system.
To check the current timezone of your system, you can run the following command in your terminal
root@codesposts:~$ timedatectl
Local time: Wed 2019-07-24 22:43:42 UTC
Universal time: Wed 2019-07-24 22:43:42 UTC
RTC time: Wed 2019-07-24 22:43:42
Time zone: Etc/UTC (UTC, +0000)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
To display the list of available timezones, run the following command
[root@codesposts ~]# timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
....
..
America/Dawson
America/Dawson_Creek
America/Denver
America/Detroit
America/Dominica
America/Edmonton
America/Eirunepe
America/El_Salvador
America/Fortaleza
America/Glace_Bay
....
..
Pacific/Saipan
Pacific/Tahiti
Pacific/Tarawa
Pacific/Tongatapu
Pacific/Wake
Pacific/Wallis
If you want to display the list of timezone for specific region, you can use the following command
[root@codesposts ~]# timedatectl list-timezones | grep Asia
This command will display all the Asian timezones
To change your current timezone in ubuntu 18.04 LTS, you can run the following command
root@codesposts:~$ unlink /etc/localtime
Then run the following command
root@codesposts:~$ ln -s /usr/share/zoneinfo/[Zone/TimeZone] /etc/localtime
You can check the current timezone again to verify the new timezone
[root@codesposts ~]# timedatectl list-timezones
If you are using any older version of Ubuntu (16.04 or older), you can follow the steps below
Before changing the timezone of your system, you should first check the current timezone of your system.
[root@codesposts ~]# date
Wed July 24 17:52:58 EST 2019
Follow the commands below to change the timezone
root@codesposts:~$ mv /etc/localtime /etc/localtime.old
Then run this command
root@codesposts:~$ ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
Change “America/New_York” with your desired timezone.
You can check the current timezone again to verify the new timezone
[root@codesposts ~]# date
The post How To Set Or Change The Timezone On Ubuntu appeared first on CODESPOSTS.COM.
Go to Source
Author: staff
Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…
Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…
At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…
I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…
Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…
Now I want to share the DNS server installation process on your Ubuntu 20.04 server.…