Saturday, July 7, 2012

How to change Date, Time and Time Zone in Linux

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 pool.ntp.org
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

No comments:

Post a Comment