0

I want to change the server timezone and used the following commands:

cp /etc/localtime /root/old.timezone
rm /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Tehran /etc/localtime

but when I check the server timezone, then it shows:

$ date
---------

Wed Apr 22 08:15:03 UTC 2015

which is not the desired result.

Moreover, /etc/localtime contains

TZif2UTCTZif2UTC
UTC0

How do I change server timezone?

OS : CentOS

Version : 6.6
1
  • What does echo $TZ say? Does TZ=Asia/Tehran show the time in Tehran or UTC? This could be because the file Asia/Tehran was overwritten by someone who tried to set the timezone to UTC but did it incorrectly. We've seen that before… Apr 22, 2015 at 22:31

2 Answers 2

-1

To start it is not in Japan time zone. date

Mon May 4 08:37:24 EDT 2015 Follow the steps and you should get new results. May take less time than shown below EDT is now JST.

date Mon May 4 21:45:01 JST 2015

So I have gone through the example shown above with success cahngeing to Japan time zine. This is where I began type "date" and get the current date time in this example = "Mon May 4 08:37:24 EDT 2015"

Logged in as root I have success. I've done this before not as root and not good results, so my guess is that if you do this you will get good results. Though the timezone is not the same and I can't answer to that.

rm /etc/localtime

sudo rm /etc/localtime

sudo ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

date Mon May 4 21:45:01 JST 2015

See above the time is in Japan time zone local time "JST".

-1

i suggest you try this solution:

rm /etc/localtime ln -s /usr/share/zoneinfo/GMT /etc/localtime date 020122172017 hwclock --systohc

The syntax is date MMDDhhmmYYYY

You must log in to answer this question.