Setting the timezone: Difference between revisions

From Alpine Linux
m (1. Added recommendation to employ desktop environment setting, if available; 2. Indicated that tzdata is pulled in with various packages; 3. Moved introduction to Manual configuration into its section; 4. Added to Localization category)
m (Corrected addition to Localization category)
Line 14: Line 14:
  ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime
  ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime


[[Category:Localization|System Administration]]
[[Category:Localization]]
[[Category:System Administration]]

Revision as of 21:17, 2 November 2025

The timezone is typically set up at install with the setup-alpine package.

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.

Otherwise, it can also be easily configured with the setup-timezone script (used by the setup-alpine package, mentioned above), or manually.

Manual configuration

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

Timezone data files are provided by the tzdata package. It is installed as a dependency to various packages, including qt6-qtbase and swaybar. 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:

apk add tzdata
ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime