Set a Different Timezone on a Ubuntu Machine via the Terminal
How can you change the timezone used by a Ubuntu machine from the command line?
You can set a timezone for your machine with this command:
sudo timedatectl set-timezone new_timezone_name
Replace new_timezone_name
in that command with the timezone you want your machine to use.
You can get a list of available timezones with this command:
timedatectl list-timezones
This will output a list:
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
. . .
You can verify the change was made by executing:
timedatectl
That will output the timezone your machine is currently using:
Local time: Wed 2021-12-08 13:47:30 EST
Universal time: Wed 2021-12-08 18:47:30 UTC
RTC time: Wed 2021-12-08 18:47:30
Time zone: America/New_York (EST, -0500)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no
Thanks for reading and happy coding!