Question

Change Local Time Zone?

Hi there,

I acted before thinking this through. I was working in my WordPress (LEMP) site and noticed the time was off. Instead of making the Local Timezone fix in Settings > General as one normally does, I tried changing it through SSH.

This is my current configuration for $ timedatectl

                      Local time: Thu 2020-02-27 16:34:51 EST
                  Universal time: Thu 2020-02-27 21:34:51 UTC
                        RTC time: Thu 2020-02-27 21:34:52
                       Time zone: UTC (EST, -0500)
       System clock synchronized: yes
systemd-timesyncd.service active: no
                 RTC in local TZ: no

My WordPress General Settings now shows:

Universal time is 2020-02-27 16:28:00. Local time is 2020-02-27 16:28:00.

So, I’m guessing the (EST, -0500) for Time zone: UTC (EST, -0500) is coming from Local time.

When I check $ date it shows me the local EST time instead of the UTC that I’m looking for.

Despite how easy it was to mess this up, I can’t seem to undo the change.

Any advice would be greatly appreciated.

TIA!


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @aerynlynne,

The system timezone is configured by symlinking /etc/localtime to a binary timezone identifier in the /usr/share/zoneinfo directory. Alternatively, you can also check the current system’s timezone by displaying the contents of the /etc/timezone file.

cat /etc/timezone

There are a few possibilities to change the timezone. The first one is using timedatectl

timedatectl list-timezones

You’ll something like

Europe/Oslo
Europe/Paris
Europe/Podgorica
Europe/Prague
Europe/Riga
Europe/Rome
Europe/Samara

Once you identify which time zone is accurate to your location, run the following command:

sudo timedatectl set-timezone your_time_zone

For example, to change the system’s timezone to Europe/Rome:

sudo timedatectl set-timezone Europe/Rome ```

Run the timedatectl command to verify the changes

Regards,
KDSys