Simple steps to update change modify timezone in linux

There are several different ways to manage time in Linux. This quick tip will show you how to quickly change the local time to the correct time zone for the server. In this Linux tip I’ll show you how to change the localtime to your (or a) current time zone.
Location of the local time file

Linux looks at "/etc/localtime" to determine the current time of your machine. This can either be a symbolic link to the correct time zone or a direct copy of the time zone file.

Timezone files are located in "/usr/share/zoninfo/"

I change the Linux time zone by copying or making a symbolic link to from /usr/share/zoneinfo/America/Chicago to /etc/localtime

By two methods we can change Time Zone in linux RHEL 7 or RHEL 8

Method - 1

cp   /usr/share/zoneinfo/America/New_York /etc/localtime

Method -2

ln -s /usr/share/zoneinfo/America/New_York /etc/localtime

Example

[root@amitmaheshwari.in]# date
Thu Oct  3 00:10:35 EDT 2019

[root@amitmaheshwari.in]# ls -l /etc/localtime
lrwxrwxrwx. 1 root root 38 Sep 19 10:32 /etc/localtime -> ../usr/share/zoneinfo/America/New_York

[root@amitmaheshwari.in]# unlink /etc/localtime

[root@amitmaheshwari.in]# ln -s  ../usr/share/zoneinfo/UTC /etc/localtime

[root@amitmaheshwari.in]# date
Thu Oct  3 04:17:18 UTC 2019

Next
This is the most recent post.
Previous
Older Post
 
Top
Maintained By Amit Maheshwari