How to Change the Timezone in Linux
Easy steps to change timezone on "CentOS Stream release 8"
It's very simple to change the timezone of Linux machines. Sometimes as DBA you need to change the timezone on cloud environments when you handling multiple sites on the cloud.
Just follow the below steps to "Change the Timezone in Linux" :-
1) login with root or any sudo user to your machine and check current timezone.
[root@TEST-D01 ~]# timedatectl
Local time: Tue 2021-07-13 03:40:06 EEST
Universal time: Tue 2021-07-13 00:40:06 UTC
RTC time: Tue 2021-07-13 00:40:06
Time zone: Europe/Kiev (EEST, +0300)
System clock synchronized: no
NTP service: n/a
RTC in local TZ: no
My Current timezone is "Europe/Kiev (EEST, +0300)".
So Let's change the timezone to Asia.
2) You can get the list of all timezones in Asia by "timedatectl list-timezones |grep Asia"
[root@TEST-D01 ~]# timedatectl list-timezones |grep Asia
Asia/Aden
Asia/Almaty
Asia/Amman
Asia/Anadyr
Asia/Aqtau
Asia/Aqtobe
Asia/Ashgabat
Asia/Atyrau
Asia/Baghdad
Asia/Bahrain
Asia/Baku
Asia/Bangkok
Asia/Barnaul
Asia/Beirut
Asia/Bishkek
Asia/Brunei
Asia/Chita
Asia/Choibalsan
Asia/Colombo
Asia/Damascus
Asia/Dhaka
Asia/Dili
Asia/Dubai
Asia/Dushanbe
Asia/Famagusta
Asia/Gaza
Asia/Hebron
Asia/Ho_Chi_Minh
Asia/Hong_Kong
Asia/Hovd
Asia/Irkutsk
Asia/Jakarta
Asia/Jayapura
Asia/Jerusalem
Asia/Kabul
Asia/Kamchatka
Asia/Karachi
Asia/Kathmandu
Asia/Khandyga
Asia/Kolkata
Asia/Krasnoyarsk
Asia/Kuala_Lumpur
Asia/Kuching
Asia/Kuwait
Asia/Macau
Asia/Magadan
Asia/Makassar
Asia/Manila
Asia/Muscat
Asia/Nicosia
Asia/Novokuznetsk
Asia/Novosibirsk
Asia/Omsk
Asia/Oral
Asia/Phnom_Penh
Asia/Pontianak
Asia/Pyongyang
Asia/Qatar
Asia/Qostanay
Asia/Qyzylorda
Asia/Riyadh
Asia/Sakhalin
Asia/Samarkand
Asia/Seoul
Asia/Shanghai
Asia/Singapore
Asia/Srednekolymsk
Asia/Taipei
Asia/Tashkent
Asia/Tbilisi
Asia/Tehran
Asia/Thimphu
Asia/Tokyo
Asia/Tomsk
Asia/Ulaanbaatar
Asia/Urumqi
Asia/Ust-Nera
Asia/Vientiane
Asia/Vladivostok
Asia/Yakutsk
Asia/Yangon
Asia/Yekaterinburg
Asia/Yerevan
Now We have the list of all timezones in Asia. Let's set it e.g. to Asia/Qatar.
3. To change the timezone from Europe/Kiev to Asia/Qatar. just run
[root@TEST-D01 ~]# timedatectl set-timezone Asia/Qatar
[root@TEST-D01 ~]# timedatectl
Local time: Tue 2021-07-13 04:02:48 +03
Universal time: Tue 2021-07-13 01:02:48 UTC
RTC time: Tue 2021-07-13 01:02:49
Time zone: Asia/Qatar (+03, +0300)
System clock synchronized: no
NTP service: n/a
RTC in local TZ: no
No comments:
Post a Comment
Really Thanks