Changing the Time Zone in on Amazon Linux 2

Before changing the time zone, you’ll need to find out the long name of the time zone you want to use. The time zone naming convention usually uses a “Region/City” format.

To view all available time zones, use the timedatectl command or list the files in the /usr/share/zoneinfo directory:

 timedatectl list-timezones

The output will be:

...
America/Montserrat
America/Nassau
America/New_York
America/Nipigon
America/Nome
America/Noronha
...

Once you identify which time zone is accurate to your location, run the following command as root or sudo user:

sudo timedatectl set-timezone <your_time_zone>

For example, to change the system’s timezone to Europe/Brussels you would type:

sudo timedatectl set-timezone Europe/Brussels

To verify the change, invoke the timedatectl command again:

timedatectl

The output will be:

      Local time: Fri 2022-06-17 14:04:18 CEST
  Universal time: Fri 2022-06-17 12:04:18 UTC
        RTC time: Fri 2022-06-17 12:04:18
       Time zone: Europe/Brussels (CEST, +0200)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2022-03-27 01:59:59 CET
                  Sun 2022-03-27 03:00:00 CEST
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2022-10-30 02:59:59 CEST
                  Sun 2022-10-30 02:00:00 CET

You’ve successfully changed your system’s time zone.

Comments

Popular posts from this blog

Installing the Certbot Let’s Encrypt Client for NGINX on Amazon Linux 2

psql: error: connection to server at "localhost" (127.0.0.1), port 5433 failed: ERROR: failed to authenticate with backend using SCRAM DETAIL: valid password not found

Deploy Nuxt.js app using Apache 2