HowTo: Linux Server Change OR Setup The Timezone

My Linux systems timezone is pointing to the wrong timezone. How do I setup or change the timezone under Linux operating systems?

Unix time, or POSIX time, is a system for describing points in time: it is the number of seconds elapsed since midnight UTC on the morning of January 1, 1970, not counting leap seconds. The definition for time zones can be written in short form as UTC±n (or GMT±n), where n is the offset in hours. You can use the following commands:
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements None
Est. reading time N/A
[a] setup or redhat-config-date for RHEL based distros. [b] dpkg-reconfigure tzdata for Debian based distros. [c] ln command – Generic method for all other distros.

Command to change the Linux timezone

You need to type the following commands as per your Linux distribution.

If you are using Fedora / RHEL / Cent OS Linux

Type the redhat-config-date command at the command line to start the time and date properties tool, run:
# redhat-config-date
OR type setup and select time zone configuration. This tool is recommended for remote ssh text based sessions.
# setup
Select timezone configuration

Fig.01: Redhat / CentOS Server Setting Up Timezone

Just follow on screen instructions to change the timezone.

If you are using Debian / Ubuntu Linux

To change the timezone for you run the following command as root user:
# dpkg-reconfigure tzdata
Again, just follow on screen instructions.

Set timezone using /etc/localtime configuration file [any Linux distro]

Often /etc/localtime is a symlink to the file localtime or to the correct time zone file in the system time zone directory.

Generic procedure to change timezone under Linux

Cd to /etc, run:
# cd /etc
Create a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/EST localtime
OR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends):
# ln -sf /usr/share/zoneinfo/EST localtime
OR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime
Please note that in above example you need to use directory structure i.e. if you want to set the timezone to Calcutta (India) which is located in the Asia directory.

How do I verify new settings?

Use the date command to verify that your timezone is changed:
$ date

Tue Aug 27 14:46:08 EST 2006

How do I use of environment variable called TZ?

You can use TZ environment variable to display date and time according to your timezone:
$ export TZ=America/Los_Angeles
$ date

Sample Output:

Thu Aug 27 11:10:08 PST 2006

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 63 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
63 comments… add one
  • vijay Dec 20, 2006 @ 8:19

    Great Info

  • Lars Nov 19, 2007 @ 6:51

    On Ubuntu you can do


    to select and set the time zone.
    (tzconfig copies the right time zone file from /usr/share/zoneinfo to /etc/localtime and puts the name of the timezone into /etc/timezone)

    • Kashif Feb 27, 2012 @ 9:32

      tzconfig is deprecated, use without “dpkg-reconfigure tzdata”

      • Kashif Feb 27, 2012 @ 9:33

        Opps! I mean use without quotes :-)

  • Rich Jun 18, 2008 @ 21:52

    Counterintuitively, you should not symlink, only ever copy timezone data files. This is because some programs might attempt to alter /etc/localtime. Before you make a change, notice that /etc/localtime is a regular file.

  • Andy Bach Nov 3, 2008 @ 19:45

    Note – you’re missing an ‘e’ on the end of:
    Create a symlink to file localtime:
    # ln -sf /usr/share/zoneinfo/EST localtim


  • 🐧 nixCraft Nov 4, 2008 @ 7:34


    Thanks for pointing out a typo. The faq has been updated.

  • Ral Nov 4, 2008 @ 18:24

    I don’t get to change the TZ. I cann’t install the tzconfig. I have Ubuntu 8.04. What is wrong ?

  • php trivandrum Nov 10, 2008 @ 1:52

    Hey.. thanks.. it saved my life..

  • am Dec 2, 2008 @ 9:33

    [root@ps2844 ~]# date
    Tue Dec 2 10:19:11 UTC 2008

    Using the “setup” command, I selected timezone as Asia/Calcutta, and did not check the UTC box. But the time zone does not change.

    [root@ps2844 ~]# setup
    [root@ps2844 ~]# date
    Tue Dec 2 10:20:26 UTC 2008

    Also, I did the sym-link for localtime, but without help.

    [root@ps2844 ~]# ls -l /etc/localtime
    lrwxrwxrwx 1 root root 33 Dec 2 10:16 /etc/localtime -> /usr/share/zoneinfo/Asia/Calcutta

  • R.H. Hartman Jan 8, 2009 @ 13:11

    On CentOS5, the command is system-config-date. Likely on CentOS4 and earlier as well. Probably related to removing all branding from the upstream vendor’s sources.

  • yemurai Feb 20, 2009 @ 4:26

    Thanks! (system-config-date) That worked.

  • adityo Apr 30, 2009 @ 5:23

    use tzselect for ubuntu gutsy

  • MANOJ PARMAR Jun 3, 2009 @ 2:43

    1.Iam having a linux virtual machine running apache server in RHEL4.4. Iam facing a problem that everyday in the morning I had to change its date and time . It is always running 12hrs back.

    • Nate Cummings Jan 17, 2012 @ 15:22

      Use an NTP cronjob to update your time

  • MANOJ PARMAR Jun 3, 2009 @ 2:48

    1. iam also facing problem in RHJEL 5.2 virtualization. Iam having one host machine installed with RHEL 5.2. Iam also running 03 Server Virtually on it. But via network i can access virtual machine but not the host machine. Many tinme I had to restart the network service but after some time the problem exist. The service is also put under chkconfig.

    2. Iam having a linux virtual machine running apache server in RHEL4.4. Iam facing a problem that everyday in the morning I had to change its date and time . It is always running 12hrs back.

  • Mark Finch Jun 20, 2009 @ 13:23

    Thanks a lot. This really helped me.

  • Andreas Jul 1, 2009 @ 8:38

    On CactiEZ 0.6 (based on CentOS) the command is ‘tzselect’ too.
    No more system-config-date or ‘config’


  • Irisha Stacy Aug 20, 2009 @ 23:35

    Slackware dudes, use tzselect;

    Or simply create a symbolic link called


    from the suitable zones resides in /usr/share/zone

    God bless god,

  • Kamal Sep 18, 2009 @ 6:56

    Thanks buddy, it helped me a lot!!

  • Jan Oct 31, 2009 @ 21:01

    Does anybody know what can be done on SUSE if this does not work for some TZ? UTC works for example, but setting to Europe/Berlin or GB does not. These give back an empty value when using

    date +%Z

  • Justin Nov 4, 2009 @ 21:54

    RHEL 5 is also using tzselect as the command name.

  • Martin Jan 5, 2010 @ 1:34

    OH MY GAD! Thank you for this article. I searched a long time to find this solution that finally worked. I use proxmox and this was the only thing that did it.

  • devkumar Mar 28, 2010 @ 11:57

    Thanks budy ,
    I have same issue which has been resolved with help of you guys

  • syed khalid Apr 4, 2010 @ 9:21

    My Hp-ux server showing wrong time …so how can i change it…
    hp-ux server:HP-UX B.11.11 U 9000/800 941485843 unlimited-user license
    and if i change hp-ux server is it change in oracle database also..

  • Chandan Apr 23, 2010 @ 4:11


    How to change the TimeZone of the server based in London but it has same TZ as Paris.
    We have Linux server.
    Using command line and which files to be modified.

    Can any one help me out for the above.

  • Adam Monsen Jul 8, 2010 @ 22:08

    FYI, on Ubuntu 10.04, I also thought it was necessary to manually maintain /etc/localtime, /etc/timezone and friends to change to Asia/Calcutta. But I noticed when running “dpkg-reconfigure tzdata” that Asia/Kolkata does show up, and this is the same city/timezone. redhat-config-date might do something similar, I don’t know.

    /usr/share/zoneinfo/Asia/Calcutta and /usr/share/zoneinfo/Asia/Kolkata point to the same inode on my system.

  • Mohamed Yusuf Jul 28, 2010 @ 8:34

    It works. Thanks a lot.

  • Hariharan Madhavan Jul 31, 2010 @ 6:43

    Thanks a bunch. I found this extremely useful to set my Server time to Indian TimeZone.

  • yogesh Aug 23, 2010 @ 12:39

    It worked thanks a lot

  • Luis Sep 24, 2010 @ 18:05

    using fedora… “rm /etc/localtime” first and then make the link , worked for me.

    Now amsn works fine and my local time now its right.

    thx a lot.

  • Jane Jan 19, 2011 @ 23:31

    I mistakenly typed in date -u now it always shows date in UTC time, everytime I type date. I want the date to revert back to showing PST time when I type date.
    How do I revert back for date to just PST time agan.

  • Hugo Jan 20, 2011 @ 13:57

    Don’t use “system-config-date” if you have build the symbolic link like

    [root zoneinfo]# ls -l /etc/localtime
    lrwxrwxrwx 1 root root 23 Jan 20 13:43 /etc/localtime -> /usr/share/zoneinfo/GMT

    It could corrupt your original file “/usr/share/zoneinfo/GMT”

    I was puzzling weeks on it to find out that my original files were corrupted.
    I got that hint from another thread out there.

  • jdros Feb 9, 2011 @ 16:22

    For Debian/Ubuntu, you have to edit



    • use
      dpkg-reconfigure tzdata

      , or

    • browse to

      and locate your city in (relative) directory/file tree, i.e. Europe/Athens; put this exact string in



  • padil Mar 3, 2011 @ 6:58


    I tried to configure timezone on CentOS with VMware,

    ln -s /usr/share/zoneinfo/Asia/Jakarta /etc/localtime

    and the results were successful, but there are differences in time with my computer. I am confused where lies the problem, please help, thx before

  • cmyster Mar 15, 2011 @ 9:58

    In Arch, simply edit /etc/rc.conf and modify TIMEZONE.
    it sould be the relative path to the zoneinfo file in /usr/share/zoneinfo
    for example to set your local time to New York:
    > cd /usr/share/zoneinfo/
    > find . -name New_York

    now edit rc.conf:

  • Pragnesh Apr 21, 2011 @ 11:28

    I want it to work for ‘UBUNTU’.
    Please help.

  • Basil Apr 26, 2011 @ 16:27

    So after I use the /etc/localtime method sure if I type date the response from date is in the right timezone, but what about every running task, they are still using the old timezone. examples are crontab, mysqld, etc… obviously booting the system does ensure everything changes over, and cycling crontab for example fixes it, but is their a easy way to sync all without an outage.

  • Mohamed ibrahim May 30, 2011 @ 4:24

    Dear Vijay,
    My Linux mechines are running under vmware server. My server time is changed every day. I reset my time every date with date -s command. But my windows mechines are running good. Time variation between linux and windows varied. Every day morning my clock shows 09:00 o clock but my server shows 09:50 or 10:00 or 10:03…. How do i set my linux box time constantly

  • frank Jun 10, 2011 @ 10:43

    can you help change time zone for linux suse

  • asdf Aug 18, 2011 @ 15:17

    suse: use yast

  • Rangalal Gamage Aug 26, 2011 @ 9:21

    It works for ubuntu/kubuntu also. Thanks a lot.

  • Chris Sep 1, 2011 @ 4:42

    Thanks! The ln method worked fine on FC14.
    I noticed that some things (httpd) do not pick up the change until restarted.

  • krusha Oct 14, 2011 @ 4:40


    I running shell script in Ec2-amazon web service.I dont want to change the time zone of server rather wanted to know with some command if I can get IST time.By default it shows UTC .I think if we pass some parameter with date command ,it should work. Please help me out .

  • pravinthali Dec 21, 2011 @ 11:54

    really a valuable information……………Thanks for that piece.

  • littleguy Jan 3, 2012 @ 21:25

    Setting timezone via /etc/localtime worked fine in CentOS 6!

  • Robin Mar 14, 2012 @ 14:18

    Are restarts usually required for any Linux distro for the timezone change to
    truly occur?

  • seachen Mar 20, 2012 @ 17:47

    i use Malaysia time zone.

    how to change it to MYT?

  • Mark May 23, 2012 @ 9:08

    I just wanted to shed some light on troubleshooting a time setting issue when rebooting.

    The /etc/rc.sysinit file sets the system time (on bootup) based on the settings in /etc/sysconfig/clock. If UTC is set to true, it will set the system time based on this command:

    hwclock --utc --hctosys

    If “hwclock –utc” shows a different time than “date”, that may mean the hardware clock is set using local time instead of UTC.

    # hwclock --utc
    Wed 23 May 2012 09:04:55 AM GMT-3  -0.970446 seconds
    # date
    Wed May 23 06:05:01 GMT-3 2012
    # hwclock
    Wed 23 May 2012 06:06:49 AM GMT-3  -0.392815 seconds

    So you can clearly see that the time is set using local time and not UTC.

    Here is the step by step fix:
    1. login to server
    2. type “date” to check the date/timezone
    3. type “setup” and then choose “Timezone Configuration” to choose the correct timezone (GMT -3)
    4. type “date” to check if it took
    5. if time is incorrect, type “date MMDDhhmm” (ex. date 05230416)
    6. change UTC=false in /etc/sysconfig/clock
    7. sync hardware clock “hwclock –systohc”

    I hope this was as helpful to you as it was to me.

  • Ed Greenberg Jun 5, 2012 @ 14:23

    It’s a good idea to restart syslog after changing the timezone, so it picks up the change.

  • Ebad Jun 11, 2012 @ 14:07

    For CentoS timezone select command: tzselect

  • sandeep Nov 5, 2012 @ 12:42

    Hi Vivek,

    You are written “Please mote that” instead of “Please note that” :)

  • en Jan 28, 2013 @ 8:50

    Thank you! Worked well with Ubuntu 12.04. Had to restart apache2 and rsyslog (as noted in an earlier comment).

  • vanarp Feb 24, 2013 @ 13:24

    you always have the solution ready for all my linux related problems. this site really empowers me to self-manage my budget vps without having to pay $$$.

  • abu Apr 11, 2013 @ 10:18

    Great Info!

  • Nikhil Jun 6, 2013 @ 9:15

    Thank You :) This is very useful…

  • Ikram Ali Jul 9, 2013 @ 6:07

    Good Info column…Thanks to creator

  • Asle Aug 3, 2013 @ 18:32

    On my Centos 5.9 the command is:

    I do not see any config alternative when I type “setup” and the command “redhat-config-date” is not on my system. But “tzselect” does the job.

  • Status Aug 26, 2013 @ 19:24

    The timezone I need to change is for the virtual server.
    Do I need to change the timezone for the parent server as well to make the timestamp consistent throughout the log files in rhel virtual server?

  • Olaf Schwartzkopf Apr 10, 2014 @ 15:00

    A very big help. Thank you!

  • Siddhesh May 29, 2014 @ 10:23

    Thanks a lot for that command , it was very help full

  • Joht Sep 26, 2015 @ 17:14

    i have issue am using Linux dd 3.16.0-49-generic #65~14.04.1-Ubuntu SMP Wed Sep 9 10:03:23 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

    time keep changing even i put timezone to asia as my current time and it keep changing +1 day every second it gives me new time !!

  • ABC Mar 13, 2016 @ 7:23

    Thanks for `dpkg-reconfigure tzdata`…

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum