Setting the timezone: Difference between revisions

From Alpine Linux
m (→‎Manual configuration: Use path and pkg templates.)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Please note: Only for NON uclibc installs==
Timezone can easily be configured with the [[Setup-alpine#setup-timezone|setup-timezone]]  script.


glibc based installs use different timezone setup.
The approach below is only convenient for systems that need frequent timezone changes, potentially while offline.


apk add tzdata
= Manual configuration=
ls /usr/share/zoneinfo
 
Suppose you want to use Brussels
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:
First copy the proper zone to localtime
 
  cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime
apk add {{pkg|tzdata|arch=}}
Now specify your timezone
  ln -s /usr/share/zoneinfo/Europe/Brussels /etc/localtime
echo "Europe/Brussels" >  /etc/timezone
 
date
[[Category:System Administration]]
Result: Wed Mar  8 00:46:05 CET 2006

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