Precision is crucial. Accurate usage of timezone is integral to the smooth operation of your applications and services. Here are the steps to achieve this:
List Available Timezones:
Set Your Desired Timezone:
sudo timedatectl set-timezone Your/Timezone.
For instance, to set your server timezone to New York, you would execute
sudo timedatectl set-timezone America/New_York.
GPS Trackers and IoT Servers: For those working with GPS trackers or setting up IoT servers that gather data from various devices, most trackers require the server timezone to be UTC. This can be set using the command
sudo timedatectl set-timezone UTC.
Verify the Configured Timezone: To ensure the timezone has been correctly set, use
An example output would look as follows:
root@server:~# timedatectl Local time: Thu 2020-07-23 21:30:05 UTC Universal time: Thu 2020-07-23 21:30:05 UTC RTC time: Thu 2020-07-23 21:30:06 Time zone: UTC (UTC, +0000) System clock synchronized: yes systemd-timesyncd.service active: yes RTC in local TZ: no
Enable NTP Synchronization: To facilitate NTP synchronization, run the following commands
sudo apt-get update and then
sudo apt-get install ntp.
By following these steps, you will successfully set the time and timezone on your Ubuntu 20.04 server.
We encourage continued learning and collaboration.