This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Thursday, October 26, 2017

How to Covert the Time Zone in Linux Server?

Below steps are used to Covert the GMT time zone UTC time zone.

1. Check the current Time zone.

[root@testserver ~]# date
Tue Feb  7 07:51:59 GMT+6 2017

2. List the available Time zone (Check the UTC is abavilable or not)

[root@testserver ~]# ls /usr/share/zoneinfo/Etc/

Linvirtshell.com

3. Copy the UTC Time Zone file to /etc/localtime & run the date command to verify.

[root@testserver ~]# cp /usr/share/zoneinfo/Etc/UTC /etc/localtime
cp: overwrite `/etc/localtime'? y
[root@testserver ~]#
[root@testserver ~]# date -u
Tue Feb  7 13:52:32 UTC 2017
[root@testserver ~]# date
Tue Feb  7 13:52:33 UTC 2017


Some special case (RHEL 6.9), need to update the /etc/sysconfig/clock file as well.

[root@testserver ~]#cat  /etc/sysconfig/clock
ZONE="Asia/Kuala_Lumpur"

Hope it helps

No comments:

Post a Comment