Setting the timezone: Difference between revisions

From Alpine Linux
mNo edit summary
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)
Line 1: Line 1:
Timezone can easily be configured with the [[Setup-alpine#setup-timezone|setup-timezone]]  script.
The timezone is typically set up at [[Installation#Base_configuration|install]] with the [[Alpine_setup_scripts#setup-alpine|setup-alpine]] package.  


The approach below is only convenient for systems that need frequent timezone changes, potentially while offline.
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-alpine#setup-timezone|setup-timezone]] script (used by the '''setup-alpine''' package, mentioned above), or manually.


= Manual configuration=
= Manual configuration=


Timezone data files are provided by the {{Pkg|tzdata}} package. The current timezone is defined in the {{path|/etc/localtime}} file. To change the timezone, make this file a link to another timezone data file. For example:
The approach below is only convenient for systems that need frequent timezone changes, potentially while offline.
 
Timezone data files are provided by the {{Pkg|tzdata}} package. It is installed as a dependency to various packages, including {{Pkg|qt6-qtbase}} and {{Pkg|swaybar}}.  The current timezone is defined in the {{path|/etc/localtime}} file. To change the timezone, make this file a link to another timezone data file. For example:


  apk add {{pkg|tzdata|arch=}}
  apk add {{pkg|tzdata|arch=}}
  ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime
  ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime


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

Revision as of 21:13, 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