recent

Titulo

Changing Linux TimeZone

Changing Linux Timezone:
How often do you get a request to change a timezone on Linux Server? This is almost never requested because the Server is created with standard timezone for your company. Server Administrator selects the correct timezone for you requirement and there is no need to change at all.

Recently, we added QA Linux Server to our existing environment of DEV, UAT and PROD.  We configured and installed Replication tool and started adding replication task and then we started to notice wrong timezone from this newly added replicated Server. This is because the replication tool was using localtime from the host. The local timezone on QA Server was different from DEV/UAT/PROD which was noticed later.

Whatever the case may be either Server Administrator failed to setup proper timezone or the requirement changed later, below are the steps to change CST timezone to EST. This change requires root access.

Check Server Time Zone:
# date
Mon Apr 13 20:21:22 CST 2020
Delete localtime file under /etc:
# cd /etc
# rm localtime
All US timezone are listed under the user/share/zoneinfor/
# ls /usr/share/zoneinfo/US/
Alaska          Arizona         Eastern         Hawaii          Michigan        Pacific
Aleutian        Central         East-Indiana    Indiana-Starke  Mountain        Samoa
Link the Pacific file from the above US directory to the /etc/localtime directory as shown below.
# cd /etc
# ln -s /usr/share/zoneinfo/US/Eastern localtime
Check Server Time Zone:
# date
Mon Apr 13 21:30:22 EST 2020
We just have changed the timezone from CST to EST on Linux Red Hat. There are various other ways to change as well and don't forget to login as root user to perform this change and validated the change.


Interested in working with me? I can be reached at pbaniya04[at]gmail.com for any questions, consulting opportunities or you may drop a line to say HELLO. Thank your again for visiting my blog and looking forward to serving you more.

Have a Database-ious Day!

No comments

Powered by Blogger.