Amazon Linux instances are set to the UTC (Coordinated Universal Time) time zone by default, but you may wish to change the time on an instance to the local time or to another time zone in your network.
These procedures are intended for use with Amazon Linux. For more information about other distributions, see their specific documentation.
To change the time zone on an instance
- Identify the time zone to use on the instance. The
/usr/share/zoneinfo
directory contains a hierarchy of time zone data files. Browse the directory structure at that location to find a file for your time zone.[ec2-user ~]$
ls /usr/share/zoneinfo
Africa Chile GB Indian Mideast posixrules US America CST6CDT GB-Eire Iran MST PRC UTC Antarctica Cuba GMT iso3166.tab MST7MDT PST8PDT WET Arctic EET GMT0 Israel Navajo right W-SU ...
Some of the entries at this location are directories (such asAmerica
), and these directories contain time zone files for specific cities. Find your city (or a city in your time zone) to use for the instance. In this example, you can use the time zone file for Los Angeles,/usr/share/zoneinfo/America/Los_Angeles
. - Update the
/etc/sysconfig/clock
file with the new time zone.- Open the
/etc/sysconfig/clock
file with your favorite text editor (such as vim or nano). You need to use sudo with your editor command because/etc/sysconfig/clock
is owned byroot
. - Locate the
ZONE
entry, and change it to the time zone file (omitting the/usr/share/zoneinfo
section of the path). For example, to change to the Los Angeles time zone, change theZONE
entry to the following:ZONE="
America/Los_Angeles
"Note Do not change theUTC=true
entry to another value. This entry is for the hardware clock, and does not need to be adjusted when you're setting a different time zone on your instance. - Save the file and exit the text editor.
- Create a symbolic link between
/etc/localtime
and your time zone file so that the instance finds the time zone file when it references local time information.[ec2-user ~]$
sudo ln -sf /usr/share/zoneinfo/
America/Los_Angeles
/etc/localtime - Reboot the system to pick up the new time zone information in all services and applications.
[ec2-user ~]$
sudo reboot
Reference Link.
Energy Saving Sensors Made by Highly Components Pvt. Ltd. - Which is the leading company in the field of Security related products in India. The company has achieved an unrivalled position in the market by introducing PIR Motion Sensors for automatic control of lights apart from other Security Sensors. Energy Saving Sensors in New Delhi
ReplyDeleteSmoke Alarm Sensor
Changing time zone on Amazon can be frustrating that is why I am here now looking for professional and wise assistance.
ReplyDelete