How to change Date, Time and Time Zone in Linux

by jagbir on May 15, 2008

In Redhat based distro, here’s a quick solution to change your time zone to PST/PDT:

$ mv /etc/localtime /etc/localtime.Old && ln -s /usr/share/zoneinfo/PST8PDT /etc/localtime

Other commands:

Change Time zone to IST:

$ mv /etc/localtime /etc/localtime.Old && ln -s /usr/share/zoneinfo/Asia/Calcutta /etc/localtime

Set the TZ environment variable for quick display time according to preferred Time Zone:

$ export TZ=America/Los_Angeles
$ date

If you have the utility rdate, update the current system time by executing

$ rdate -s

You can execute ‘system-config-date’ for setting up date/time and time zone

$ system-config-date

If you’re using Ubuntu, tzconfig is there for you:

$ tzconfig

You may also like to read:
* 5 steps to secure your Linux Server
* Ensuring secure access to production Linux Servers
* Bash script to backup essential log files in Linux
* Quickly change your ssh port from defualt 22 to something higher
* SSH port forwarding from remote to local machine
* Save root or user history to check later
* Install and configure denyhost to prevent brute force attacks

  • Barbra Ronca

    Great I have read your article and by the way I found you website on Yahoo and I think after I read particularpost on you website especially this one I have my own comment about what should I comment on the next meeting with my girl friend, maybe tomorrow I will tell my familyabout this one and get debate.

  • partner suche

    Hallo, zahlreichen angesichts im Zuge alle Kommuniqu� ich werde bei ihnen aktuell vielleicht ein paarmal nicht mehr auf der H�he der Zeit schauen.

Previous post:

Next post: