Categories: Linux

Change Linux Timezone (RHEL / CentOS)

You can change Linux Timezone via bash command line easily.

  • All Timezone information are stored in /usr/share/zoneinfo/.
  • /etc/localtime is symlink to Timezone file stored in /usr/share/zoneinfo/.

Display Current Timezone

When you run the command below, you see which timezone file linked to the localtime symlink.

 ls -l /etc/localtime 

Alternative Method

 [root@rhel75 ~]# timedatectl | grep -i 'time zone'
        Time zone: Europe/Istanbul (+03, +0300) 

Change Linux Timezone

When you run commands below respectively, active timezone on run-time has been changed. Also let’s copy current localtime file as backup plan.

# mv /etc/localtime /etc/localtime.yedek
# ln -s /usr/share/zoneinfo/Europe/Istanbul /etc/localtime 

For permanent change, we need to do the same change on /etc/sysconfig/clock file.

# cat /etc/sysconfig/clock
ZONE="Europe/Istanbul"
UTC=true
ARC=false

Alternative Method

You can use timedatectl utility to display current timezone information as an alternative to the symlink method.

[root@rhel75 ~]#  timedatectl set-timezone Europe/Istanbul

You can reach out the full list of timezone information using link below;

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

burakalakus

Share
Published by
burakalakus

Recent Posts

Avaya SAL Gateway

Avaya SAL Gateway (Secure Access Link) is a remote connectivity solution used by Avaya to provide remote support for its… Read More

5 years ago

DALI Protocol (Digital Addressable Lighting Interface)

DALI is a communication protocol that is used for the automation of lighting, which is not new at all. It… Read More

5 years ago

Manchester Code Explained

Communication requires being in sync just like an orchestra. What happens when the bass guitar in band is not sync… Read More

5 years ago

Secure Server Access with SSH Key without Password

You have access to many different Linux / Unix servers during the day, you are in the IT department, remembering… Read More

8 years ago

iPad Mini in CAR explained

CAR PC in car is now old school and I decided to mount an iPad mini into the dashboard. (more…) Read More

11 years ago

Carputer Project

I've been waiting to write about my project "Carputer", for a long time. I tried to share  all details step… Read More

12 years ago