drugopk.blogg.se

How to change timezone linux centos
How to change timezone linux centos








how to change timezone linux centos

sudo ln -sf /usr/share/zoneinfo/America/Phoenix To change the timezone, replace the symbolic link with that of the correct timezone file for your server. In the example above, we can see the /etc/localtime file is symbolically linked to the America/Toronto timezone file. ls -la /etc/localtime lrwxr-xr-x 1 root wheel 41 30 Aug 22:12 /etc/localtime -> /var/db/timezone/zoneinfo/America/Toronto To get a basic view of the timezone you can ls the file to it’s symbolic link.

how to change timezone linux centos

This file is actually a symbolic link to a timezone file under /usr/share/zoneinfo.

how to change timezone linux centos

The timezone on a RedHat and CentOS server is stored set by the /etc/localtime file. sudo timedatectl set-timezone America/Phoenix Setting Timezone with Symbolic Link For example, to set the server’s timezone to America/Phoenix, you would run the following command. Once you have the timezone you want to set the system to, you use the timedatectl set-timezone command with the name of the timezone.

how to change timezone linux centos

timedatectl list-timezones | grep America. If you have an idea which timezone you want, you can pipe timedatectl into the grep command. You could browse the list by piping the timedatectl command into the less command. timedatectl list-timezones Africa/Abidjan You can view a list of supported timezones using the timedatectl list-timezones command. In order to set your timezone you should probably list the available zones. In the example below, we can see the server’s time zone is America/New_York, and the offset is -0400. To get detailed information your CentOS server’s date, time, and timezone you use the timedatectl command. You will also learn how to view this linked file and how to update your timezone by changing the link. The timedatectl command is a relatively new addition to Systemd distributions, and provides a much simpler interface for viewing and adjusting a server’s date and time.ĬentOS and RedHat still use symbolically linked files to set the system’s timezone. In this tutorial, you will learn how to check and set your Timezone in CentOS.










How to change timezone linux centos