Changing timezone in linux can be done using the below steps. Timezone is set using a symbolic link at /etc/localtime.
1. Check Date
[root@vidhya-dev-vm1 ~]# date
Tue Nov 20 14:23:51 IST 2012
2. To see how the current localtime is set
[root@vidhya-dev-vm1 ~]# ll /etc/localtime
lrwxrwxrwx. 1 root root 39 Nov 20 11:47 /etc/localtime -> /usr/share/zoneinfo/right/Asia/Calcutta
3. Check all the timezones
[root@vidhya-dev-vm1 ~]# ls /usr/share/zoneinfo/
Africa Brazil Egypt GB Hongkong Jamaica MST Portugal ROK WET
America Canada Eire GB-Eire HST Japan MST7MDT posix Singapore W-SU
Antarctica CET EST GMT Iceland Kwajalein Navajo posixrules Turkey zone.tab
Arctic Chile EST5EDT GMT0 Indian Libya NZ PRC UCT Zulu
Asia CST6CDT Etc GMT-0 Iran MET NZ-CHAT PST8PDT Universal
Atlantic Cuba Europe GMT+0 iso3166.tab Mexico Pacific right US
Australia EET Factory Greenwich Israel Mideast Poland ROC UTC
1. Check Date
[root@vidhya-dev-vm1 ~]# date
Tue Nov 20 14:23:51 IST 2012
2. To see how the current localtime is set
[root@vidhya-dev-vm1 ~]# ll /etc/localtime
lrwxrwxrwx. 1 root root 39 Nov 20 11:47 /etc/localtime -> /usr/share/zoneinfo/right/Asia/Calcutta
3. Check all the timezones
[root@vidhya-dev-vm1 ~]# ls /usr/share/zoneinfo/
Africa Brazil Egypt GB Hongkong Jamaica MST Portugal ROK WET
America Canada Eire GB-Eire HST Japan MST7MDT posix Singapore W-SU
Antarctica CET EST GMT Iceland Kwajalein Navajo posixrules Turkey zone.tab
Arctic Chile EST5EDT GMT0 Indian Libya NZ PRC UCT Zulu
Asia CST6CDT Etc GMT-0 Iran MET NZ-CHAT PST8PDT Universal
Atlantic Cuba Europe GMT+0 iso3166.tab Mexico Pacific right US
Australia EET Factory Greenwich Israel Mideast Poland ROC UTC
4. Backup existing timezone and link new timezone
[root@vidhya-dev-vm1 ~]# mv /etc/localtime /root/localtime_bak
[root@vidhya-dev-vm1 ~]# ln -sf /usr/share/zoneinfo/America/Denver /etc/localtime
[root@vidhya-dev-vm1 ~]# date
Tue Nov 20 01:56:59 MST 2012
No comments:
Post a Comment