Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Set Aws Amazon Server Time? Can't find /etc/sysconfig/clock file

I need to change my time to singapore time.

I read in there documentation that i have t edit 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 get No Such File Directory

I also did ls /etc/ there really isn't any sysconfig folder. I did find a timezone File so i tried

sudo nano /etc/timezone

The file only says ETC/UTC

How do i change the timezone??

like image 765
Johanna Cristine Dy Avatar asked Dec 21 '15 11:12

Johanna Cristine Dy


1 Answers

If you cannot find /etc/sysconfig/clock, the it is probably the case that you are on a disto that doesn't use it. For at least Ubuntu 15-17 and RHEL/CentOS 7, you can use the timedatectl utility.

Show current settings

timedatectl

List available timezones

timedatectl list-timezones

Set timezone

sudo timedatectl set-timezone <timezone>

This will take care of altering the /etc/localtime symlink.

References: RHEL Guide, Ubuntu timedatectl(1)

like image 53
StvnW Avatar answered Oct 04 '22 17:10

StvnW