Setting the timezone

From Alpine Linux
Revision as of 03:41, 3 November 2025 by Prabuanand (talk | contribs) (changed heading levels and integrated the recently added content by John3-16 with additional headings)

This page documents various approaches to set the timezone in Alpine Linux. The timezone is typically set up at install with the setup-timezone script as part of setup-alpine script.

Installation

Timezone data files are provided by the tzdata package. It is installed as a dependency to various packages, including qt6-qtbase and swaybar, but if it is missing, install it as follows:

# apk add tzdata

Using setup-timezone script

Timezone can be configured anytime using the setup-timezone script.

Using desktop tools

If and when a desktop environment (DE) is eventually set up, consider using a setting there from then onwards to adjust for: (a) a change of timezone; and (b) whether it should adjust for Daylight Saving Time, Summer Time, etc. This helps to preserve the DE's approach on handling and displaying the clock.

Manual configuration

The approach below is only convenient for systems that need frequent timezone changes, potentially while offline.

Ensure that tzdata package is installed. The current timezone is defined in the /etc/localtime file. To change the timezone, make this file a link to another timezone data file. For example:

# ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime