How To Set or Change Timezone on Ubuntu
On Ubuntu, you can change date and time using "timedatectl" command line utility. Make sure that you have sudo previldeges.
To see the current date time. Run following command...
timedatectl
Local time: Mon 2022-11-28 20:15:33 UTC
Universal time: Mon 2022-11-28 20:15:33 UTC
RTC time: Mon 2022-11-28 20:15:33
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no
To see the all the time zones available, run following command...
timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
For example to change time zone to eastern time America/New_York, run following command...
sudo timedatectl set-timezone America/New_York
Now let us check if we our timezone changed...
sudo timedatectl
Local time: Mon 2022-11-28 15:17:37 EST
Universal time: Mon 2022-11-28 20:17:37 UTC
RTC time: Mon 2022-11-28 20:17:37
Time zone: America/New_York (EST, -0500)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no
Make sure to restart the services which are dependent on System time. For example you might have many CRON jobs. To make sure crontab follows the new time zone, restart the cron service.
sudo service cron restart