How to set Amazon Aws server time? Cannot find file / etc / sysconfig / clock

I need to change the time to Singapore time.

I read the documentation there that I am editing the clock file inside: / Etc. / sysconfig /

Documenation: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-time.html

I did cd /etc/sysconfig and I got No Such File Directory

I also did ls /etc/ there really is no sysconfig folder there. I found the timezone file, so I tried

 sudo nano /etc/timezone 

Only ETC / UTC is indicated in the file

How to change the time zone

+6
source share
3 answers

If the file / etc / sysconfig / clock is missing, execute it and create it. Add the two appropriate lines referenced by the documentation, create the required symbolic link, and then restart the server.

 ZONE="Asia/Singapore" UTC=false 
+6
source

There was no need to perform step 2 of the documentation. It was just necessary to execute these commands.

 sudo ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime sudo reboot 
+4
source

If you cannot find /etc/sysconfig/clock , this is probably the case if you are on a disto that does not use it. At least for Ubuntu 15-17 and RHEL / CentOS 7 you can use the timedatectl utility.

Show current settings

 timedatectl 

List of available time zones

 timedatectl list-timezones 

Set time zone

 sudo timedatectl set-timezone <timezone> 

This will take care of changing the symbolic link /etc/localtime .

Links: RHEL Guide , Ubuntu timedatectl (1)

+3
source

All Articles