Saturday, September 23, 2017

Timezone configuration in centos

#rm -rf /etc/localtime
#ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime

if fails

#vi /etc/localtime
save the file

#ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
or #cp /usr/shar/zoneinfo/Asia/Kolkata /etc/localtime

#vi /etc/sysconfig/clock
Zone="Asia/Kolkata"
#UTC=false
#ARC=false

no check
#date


My ec2 showing

# cat /etc/localtime
TZif2UTCTZif2UTC
UTC0

# rm -rf /etc/localtime

# date
Wed Feb 22 06:14:51 UTC 2017   //wrong time

# cp /usr/share/zoneinfo/Asia/Kolkata /etc/localtime

# cat /etc/localtime
ÊÛ°ÌqÌ2¨ÒtRÐ[hMX        [h      HMTBURTISTTZif2ÿÿÿÿV¶(ÿÿÿÿÊÛ°ÿÿÿÿÌqÿÿÿÿÌ2¨ÿÿÿÿÒtLMTHMTBURTIST
IST-5:30

# cat /etc/sysconfig/clock
ZONE="UTC"
UTC=True



# date
Wed Feb 22 11:45:43 IST 2017     // this is correct time

#date -R

No comments:

Post a Comment