November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

How to change Time zone in Linux

# cd /etc
# rm localtime  //delete the existing localtime file

Check the available time zones in US

# ls /usr/share/zoneinfo/US/
Alaska          Arizona         Eastern         Hawaii          Michigan        Pacific
Aleutian        Central         East-Indiana    Indiana-Starke  Mountain        Samoa

Note: For other country timezones, browse the /usr/share/zoneinfo directory

Now we can change the time zone using below step

 

 

# vi /etc/timezone
America/Los_Angeles

then export the TZ variable

$ export TZ=America/Los_Angeles
$ date

 

 
Using below interactive method also we can change the Time zone

Ubuntu: dpkg-reconfigure tzdata
Redhat: redhat-config-date
CentOS/Fedora: system-config-date
FreeBSD/Slackware: tzselect

# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime

Now check the time

#date

# date
Mon Aug 17 23:10:14 IST 2013

But if you are doing any patching then after patching this Time zone will get changed. So this method is not perfect one.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>