Thursday, June 28, 2018

Change Timezone on SUSE Linux


While doing administration Linux admin came across situation where need is to change time zone.
This situation arise because of following reason
1. Application/database requirement for time-zone change.
2. Wrongly configured Time zone by admin.
So here procedure for changing time zone.
You must be thinking why i am changing time zone, in my case while doing new installation for one of the application server i forgot to change time zone.

Let’s see ...........

While changing  time zone for server please do proper backup of setting which you are changing.
Example. Time zone setting before changing.in case of reverting back this will help you.

So generally all time zone files are in path /usr/share/zoninfo/.
Here we need to change  timezone from UTC to Pacific Time.

Step 1. Change directory to /etc
Execute command #date before changing time zone file.
# date
Mon Sep 17 22:59:24 UTC 2017

here we can see that time zone is UTC.

Step 2: Change directory to cd /etc and remove file “localtime”

#rm localtime

Step 3:
To change time zone from UTC to Pacific timezone execute following command
# cd /etc
# ln -s /usr/share/zoneinfo/US/Pacific localtime

To confirm changes again execute date command.
# date
Mon Sep 17 23:20:14 PDT 2017
Now here we changed timezone from UTC to PDT.

Thanks !!!!

No comments:

Post a Comment