****************************************************************
* Description: Knowledge of changing timezone on Linux platform
* Date: 11:36 PM EST, 01/16/2018
****************************************************************
<1> On some Linux distributions (for example, CentOS), the timezone is controlled by /etc/localtime file:
|
|__ $ date
Wed Jan 10 22:43:07 UTC 2018 on pts/0
<2> All US timezones are located under under the /usr/share/zoneinfo/US directory:
|
|__ $ ls /usr/share/zoneinfo/US/
Alaska Arizona Eastern Hawaii Michigan Pacific
Aleutian Central East-Indiana Indiana-Starke Mountain Samoa
<3> Remove or cp /etc/localtime to a different name:
|
|__ $ mv /etc/localtime /etc/localtime_bkp
<4> To change the timezone, link the target timezone file from /usr/share/zoneinfo/US/ to the /etc/localtime directory as OS root user:
|
|__ $ ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime
|
|__ $ date
Tue Jan 16 23:44:28 EST 2018
Your Comments