Change timezone in Linux

  1. Check the current time. Login as root and execute the date command: # date
  2. Backup your current localtime file: cp /etc/localtime /etc/localtime.bak
  3. Create a symbolic link to the appropriate timezone from /etc/localtime: ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
  4. Set the ZONE entry in the file /etc/sysconfig/clock (ex. “America/Los_Angeles”)
  5. Set the hardware clock by executing: /sbin/hwclock –systohc
  6. Or if you have ntp installed you can set the clock with ntpdate command: ntpdate -b time.nist.gov
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s