A fresh VPS is often set to UTC. That’s a good default, but you may want log timestamps in your local time, or need to understand why cron jobs run “at the wrong hour”. timedatectl manages the time zone and time sync on any systemd-based distribution.
Check the current settings
timedatectl
Local time: Wed 2026-10-14 17:12:03 CST
Universal time: Wed 2026-10-14 09:12:03 UTC
RTC time: Wed 2026-10-14 09:12:03
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
The lines that matter: Time zone, System clock synchronized and NTP service.
List and set the time zone
timedatectl list-timezones | grep -i america
sudo timedatectl set-timezone America/New_York
sudo timedatectl set-timezone UTC
Use the region/city names (Europe/Berlin, Asia/Tokyo), not abbreviations like EST or CST. Region names handle daylight saving time automatically.
Behind the scenes, this points the /etc/localtime symlink at the zone file under /usr/share/zoneinfo/.
On systems without systemd (some minimal containers):
sudo ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
echo "Europe/Berlin" | sudo tee /etc/timezone # Debian
# or interactively:
sudo dpkg-reconfigure tzdata
UTC or local time?
Many admins keep servers on UTC:
- There are no daylight-saving jumps. Local time skips an hour or repeats one twice a year, which can make cron jobs run twice or not at all, and confuses log analysis.
- Logs line up across servers in different regions.
- Databases and APIs usually store UTC anyway.
Applications can then show local times to users. If you work alone in one time zone and want readable logs, local time is fine. Just be aware of the DST hour.
Restart services after changing the zone
Running processes may keep the old zone until they restart. That includes cron, rsyslog, PHP-FPM and your app.
sudo systemctl restart cron rsyslog # 'crond' on RHEL family
Rebooting is the simplest way to be sure.
Cron and time zones
Cron runs jobs according to the system time zone (as of its last start). A job at 0 3 * * * runs at 03:00 local time. Some cron implementations support a CRON_TZ= variable per crontab. Otherwise, convert times yourself or use systemd timers, which accept time zones in OnCalendar= (OnCalendar=*-*-* 03:00 Europe/Berlin). See cron expressions.
Applications have their own time zone settings
PHP uses date.timezone in php.ini, independent of the system:
date.timezone = UTC
See php.ini settings.
MySQL/MariaDB default to the system zone (SYSTEM). Check it, or set it explicitly:
SELECT @@global.time_zone, NOW(), UTC_TIMESTAMP();
[mysqld]
default-time-zone = '+00:00'
Named zones need the time zone tables loaded: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql.
PostgreSQL: timezone = 'UTC' in postgresql.conf. timestamptz columns store UTC and convert on output.
Node.js, Python and Java follow the TZ environment variable or the system zone. Setting Environment=TZ=UTC in a systemd unit makes it explicit.
Docker containers usually run in UTC whatever the host uses. Set the zone per container:
environment:
- TZ=Europe/Berlin
volumes:
- /etc/localtime:/etc/localtime:ro
The TZ variable needs the tzdata package inside the image. Many slim images lack it.
Make sure time is synchronised
A correct time zone doesn’t help if the clock itself drifts. TLS certificates, TOTP two-factor codes, database replication and distributed systems all need accurate time.
timedatectl show -p NTPSynchronized
sudo timedatectl set-ntp true
set-ntp true enables systemd-timesyncd (or chrony, if installed). For servers, chrony is the more robust choice. See NTP with chrony.
Set the time manually only for testing, and only with NTP off: sudo timedatectl set-time '2026-10-14 12:00:00'.
RTC in local time
RTC in local TZ: yes mostly matters for dual-boot desktops. On servers and VMs, keep the hardware clock in UTC:
sudo timedatectl set-local-rtc 0
Quick reference
| Task | Command |
|---|---|
| Show status | timedatectl |
| List zones | timedatectl list-timezones |
| Set zone | sudo timedatectl set-timezone Area/City |
| Use UTC | sudo timedatectl set-timezone UTC |
| Enable NTP | sudo timedatectl set-ntp true |
| Current time in UTC | date -u |
| Time in another zone | TZ=Asia/Tokyo date |
Related: crontab and journalctl.