RHEL-RHCSA-clock_Timezone.md
localtime
Upon a successful login into the VM system, changing the Timezone to which the system’s time is configured can be accomplished by changing the /etc/localtime
link.
NOTE
Since the implementation ofsystemd
in RHEL7, changing the system’s default
timezone manually is not persistent; as the/etc/localtime
link gets recreated
bysystemd
after a reboot, the user must usetimedatectl
to make the desired
change persistent
To change the default timezone to the timezone of Chicago, for example, execute the following as the root
user:
# cd /etc/
# ls -alh localtime
/etc/localtime -> ../usr/share/zoneinfo/America/NewYork
# unlink /etc/localtime
# ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
/etc/localtime -> ../usr/share/zoneinfo/America/Chicago
In the above example, we have changed the timezone from the previous value, pointing to the timezone to which “NewYork” belongs, to the timezone of Chicago.
The systemd
Method for Changing the Default Timezone
Synopsis
timedatectl [OPTIONS...] {COMMAND}
Description
timedatectl may be used to query and change the system clock and its settings. Use systemd-firstboot(1) to initialize the system time zone for mounted (but not booted) system images.
timedatectl list-timezone
Shows all the available “timezones” in the form of Continent/City.
timedatectl set-timezone America/Chicago
Changes the system’s clock to follow the timezone of the city of Chicago.