Share icon
Time Zone in Linux

 

Timezone of server is just nothing but the computer date time, on which it will perform different automatic task base on cron and other software. In this page you can see how you change your server timezone using command line interface 

Check the current time zone first 

- Use command below to check the current timezone 

timedatectl

output - 

Server:~$ timedatectl
                      Local time: Wed 2021-07-07 22:21:01 IST
                  Universal time: Wed 2021-07-07 16:51:01 UTC
                        RTC time: Wed 2021-07-07 16:51:02
                       Time zone: Asia/Kolkata (IST, +0530)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no

Now you can see the list of all timezones that the server supports or available using command

timedatectl list-timezones

Output -  

$ timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Cairo
Africa/Casablanca
Africa/Ceuta
Africa/Conakry
Africa/Dakar
Africa/Dar_es_Salaam
Africa/Djibouti
Africa/Douala
Africa/El_Aaiun
Africa/Freetown
Africa/Gaborone
Africa/Harare
Africa/Johannesburg
*******

Now check the time zone based on the list above, using command

sudo timedatectl set-timezone <your_time_zone>

e.g

sudo timedatectl set-timezone America/New_York

Now the timezone is changed, your can check again by using the first command .e.g

timedatectl

and that's it. You’ve successfully changed your system’s time zone

Add new comment

Restricted HTML