Setting the timezone: Difference between revisions

From Alpine Linux
(Rewrite completely outdated article)
m (→‎Manual configuration: Use path and pkg templates.)
 
Line 5: Line 5:
= Manual configuration=
= Manual configuration=


Timezone data files are provided by te {{Pkg|tzdata}} package. The current timezone is defined in the <code>/etc/localtime</code> file. To change the timezone, make this file a link to another timezone data file. For example:
Timezone data files are provided by te {{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:


  apk add tzdata
  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:System Administration]]

Latest revision as of 04:37, 12 January 2024

Timezone can easily be configured with the setup-timezone script.

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

Manual configuration

Timezone data files are provided by te tzdata package. 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