How to Change Timezone on RHEL / CentOS 7 and 8
In this article, I’m going to share how to change the timezone on RHEL / CentOS 7 & 8.
Table of Contents
Check Current Timezone
Using these commands we can see the current date & time:
1. Using date
command:
Tue Jan 28 16:09:48 +06 2020
2. Using ls -l /etc/localtime
command:
lrwxrwxrwx 1 root root 32 Jan 27 15:44 /etc/localtime -> ../usr/share/zoneinfo/Asia/Dhaka
3. Using timedatectl command:
Local time: Tue 2020-01-28 16:21:31 +06
Universal time: Tue 2020-01-28 10:21:31 UTC
RTC time: Tue 2020-01-28 10:21:31
Time zone: Asia/Dhaka (+06, +0600)
System clock synchronized: no
NTP service: n/a
RTC in local TZ: no
Available Timezones
To see available time zones, we need to run a command like:
You’ll see the output like:
......
Asia/Dhaka
Asia/Dili
Asia/Dubai
Asia/Dushanbe
Asia/Famagusta
Asia/Gaza
......
Change Timezone
The syntax of changing timezone command is:
Select your time zone from the list. To set Asia/Dhaka
, run this command:
Step 4 : Change Timezone Using Symlink
If your server doesn’t work timedatectl
command, then follow this method. We need to delete localtime first:
Then set the timezone like this:
Now check the timezone.
The article is over. Thanks for reading. ?
Tags:
Linux