How to Set Up Timezone on VPS Ubuntu Server

Beda Arta
VPSUbuntuDatabase

For a brand new VPS Ubuntu Server, sometimes I want to change the timezone to match my current location. Here are the steps that I usually follow to update the timezone.

  1. Login to your server and check the date by running this command:
date

You will see the current date.

Sat Sep 20 07:32:40 UTC 2025
  1. Check the timezone by running this command:
timedatectl

You will see the current timezone.

 Local time: Sat 2025-09-20 07:33:41 UTC
           Universal time: Sat 2025-09-20 07:33:41 UTC
                 RTC time: Sat 2025-09-20 07:33:41
                Time zone: UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
  1. To update the timezone, for example, if you want to change it to Asia/Makassar, run this command:
sudo timedatectl set-timezone Asia/Makassar

You will be asked to enter your sudo password. After that, you will see the updated timezone.

[user]@[ip_address]:~$ timedatectl
               Local time: Sat 2025-09-20 15:34:24 WITA
           Universal time: Sat 2025-09-20 07:34:24 UTC
                 RTC time: Sat 2025-09-20 07:34:24
                Time zone: Asia/Makassar (WITA, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

After changing the timezone with timedatectl, if your database is located on the same server, you'll need to restart the database so it picks up the new system timezone. To see the system time in MySQL, log in to your MySQL server and type:

SELECT NOW(), SYSDATE();

NOW() and SYSDATE() show the current datetime based on MySQL’s timezone setting.