網頁

2013年12月1日 星期日

CentOS 6.x --- How to set Timezone, Date and Time

For AD authentication, we have to focus on Time synchronization between AD and client so that Timezone/Date/Time will be accurate on the related clients.

As to the standalone environment, it still is very important if we need to trace some logs for troubleshooting or analyzing the system and application. The only different operation is that we also have to correct it step by step manually.
How to do it? To login as root account and run the following step for this target.

Set System Timezone
To realize what zone want to be changed by executing the ls /usr/share/zoneinfo/Asia command next to add some content as ZONE=”Asia/Taipei” into the /etc/sysconfig/clock file for the proper timezone.ScreenShot002To reload the clock right now by using the source /etc/sysconfig/clock command and copy the right timezone file as Asia/Taipei under the /usr/share/zoneinfo directory to the /etc directory by using the cp –p /usr/share/zoneinfo/Asia /etc/localtime command.

Set Time and DateTo change manually the date and time by using the date - - set=”Sun Dec 1 13:37:00 CST 2013commandScreenShot001
Set Hardware Clock (RTC)
To set the current system time to the Hardware Clock by using the hwclock - -systohc command if we want to update the hardware clock.ScreenShot009So does that the accurate time will be kept after reboot.
Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.