DEV Community

Cover image for Ubuntu - How to change time-zone settings from the command line
Alexandre Freire
Alexandre Freire

Posted on

Ubuntu - How to change time-zone settings from the command line

A time zone is a region of the globe that observes a uniform standard time for legal, commercial, and social purposes. Time zones tend to follow the boundaries of countries and their subdivisions instead of strictly following longitude, because it is convenient for areas in close commercial or other communication to keep the same time.

Most of the time zones on land are offset from Coordinated Universal Time (UTC) by a whole number of hours (UTC−12:00 to UTC+14:00), but a few zones are offset by 30 or 45 minutes (e.g. Newfoundland Standard Time is UTC−03:30, Nepal Standard Time is UTC+05:45, Indian Standard Time is UTC+05:30 and Myanmar Standard Time is UTC+06:30).

Some higher latitude and temperate zone countries use daylight saving time for part of the year, typically by adjusting local clock time by an hour. Many land time zones are skewed toward the west of the corresponding nautical time zones. This also creates a permanent daylight saving time effect.

Setting up a new time zone on the system

The most ease way especially to a server is to list timezones:

timedatectl list-timezones
Enter fullscreen mode Exit fullscreen mode

And choose yours, for example:

timedatectl set-timezone America/Porto_Velho
Enter fullscreen mode Exit fullscreen mode

The changes occur at the same time, and to see the current time, type in the terminal the command

date
Enter fullscreen mode Exit fullscreen mode

Top comments (0)