Table of Contents

Debian Locale and Timezone

Configure language, character encoding, and time settings for your system.

Timezone

Show current timezone:

timedatectl

List available timezones:

timedatectl list-timezones
timedatectl list-timezones | grep America

Set timezone:

sudo timedatectl set-timezone America/New_York
sudo timedatectl set-timezone Europe/London
sudo timedatectl set-timezone UTC

Or manually:

sudo ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime

Check timezone file:

cat /etc/timezone

System Time

Enable network time sync (NTP):

sudo timedatectl set-ntp true

Show sync status:

timedatectl

Manually set time:

sudo timedatectl set-time "2024-01-15 14:30:00"

Locale

Show current locale:

locale

List available locales:

locale -a

Set system locale:

sudo update-locale LANG=en_US.UTF-8
sudo update-locale LC_TIME=en_GB.UTF-8

Reconfigure locales:

sudo dpkg-reconfigure locales

Then select locales to generate. Changes take effect after logout/login.

Keyboard Layout

Show current:

setxkbmap -query

Set temporarily:

sudo loadkeys us

Persistent configuration:

sudo dpkg-reconfigure keyboard-configuration

Then restart:

sudo systemctl restart keyboard-setup

Locale Categories

Each can be set independently:

export LC_TIME=de_DE.UTF-8
date           # shows German date format

Common Locales

Most modern systems use UTF-8; avoid older encodings (ISO-8859-1, etc.).

Tips