First, we need to configure AWS instance to use the Amazon Time Sync Service :
- Connect to your instance and uninstall the NTP service.
sudo yum erase 'ntp*'
- Install the
sudo yum install chrony
- Open the
/etc/chrony.conffile. Verify that the file includes the following line:
server 169.254.169.123 prefer iburst
- Start the
sudo service chronyd start
On RHEL and CentOS (up to version 6), the service name is
- Use the
chkconfigcommand to configure
chronydto start at each system boot.
sudo chkconfig chronyd on
Now we need to change the time zone on an instance :
2. Locate the
ZONE entry and set new time zone.
You will find a list of all time zone into /usr/share/zoneinfo/ folder
For example, to change to the Los Angeles time zone, change the
ZONE entry to the following:
Note : Please do not change the
UTC=true entry to another value. This entry is for the hardware clock
3. Create a symbolic link between
/etc/localtime and your time zone file
sudo ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
4. Reboot the system to pick up the new time zone information in all services and applications.