π Raspberry Pi β Timezone & Locale Settings (2025 Configuration Guide)
π§² Introduction β Why Set Timezone and Locale on Raspberry Pi?
Correct timezone, language, and keyboard locale settings are essential for accurate logs, proper regional formats, and seamless usage. Whether you’re developing software, scheduling cron jobs, or accessing web-based servicesβa misconfigured timezone or locale can lead to confusion and errors.
π― In this guide, youβll learn:
- How to set or change the timezone on Raspberry Pi
- How to configure system locale and keyboard layout
- How to set language and Wi-Fi country
- Commands and
raspi-configsteps for both CLI and GUI users
π What Is Locale and Why It Matters?
A locale defines regional settings for:
- Language (e.g., English, Hindi)
- Character encoding (e.g., UTF-8)
- Number formats (e.g., 1,000.00 vs 1.000,00)
- Time formats (e.g., 12-hour vs 24-hour)
- Keyboard layout (US, UK, etc.)
π Set Timezone Using raspi-config
- Open the terminal:
sudo raspi-config
- Go to:
Localisation Options β Timezone
- Select your continent/region, then your city/timezone
π Example: Asia β Kolkata
β This syncs your Raspberry Pi clock with your correct local time.
π Change Locale (Language & Encoding)
- Run:
sudo raspi-config
- Go to:
Localisation Options β Locale
- Choose one or more locales. Example:
en_US.UTF-8(American English with UTF-8 encoding)en_GB.UTF-8(UK English)
- Set the default locale when prompted
β¨οΈ Set Keyboard Layout
To set the keyboard mapping:
sudo raspi-config
β Localisation Options β Keyboard Layout
Choose:
- Generic 105-key PC (most common)
- Language β Layout (e.g., English β US or UK)
This fixes mismatches (e.g., @ vs ") for users with non-default keyboards.
πΆ Set Wi-Fi Country (Required for Wireless)
Correct Wi-Fi region is needed for:
- Legal frequency channels
- Full wireless performance
Set via:
sudo raspi-config
β Localisation Options β WLAN Country
Example: Select IN for India or US for United States.
π§ Check Your Current Settings
| π§ͺ Command | π Description |
|---|---|
timedatectl | Show current time, timezone, sync info |
locale | Show current locale settings |
localectl | Show system default locale and keyboard |
cat /etc/timezone | Print current timezone setting |
π οΈ Set Timezone Manually (Without raspi-config)
- List available timezones:
timedatectl list-timezones
- Set your desired timezone:
sudo timedatectl set-timezone Asia/Kolkata
- Verify:
timedatectl
π Regenerate Locale Files (If Needed)
If you face language or display issues, regenerate locales:
sudo dpkg-reconfigure locales
Select required locales, generate them, and set the default.
π§Ό Fix Common Locale Warnings
If you see warnings like locale not set or LC_ALL unset, fix by:
- Editing your profile:
sudo nano /etc/default/locale
Add or update:
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
Then reboot:
sudo reboot
π Summary β Recap & Next Steps
Configuring timezone and locale ensures your Raspberry Pi runs with regionally accurate settingsβcrucial for logs, displays, and user input.
π Key takeaways:
- Use
raspi-configto easily set timezone, language, keyboard, and Wi-Fi region - CLI alternatives exist using
timedatectl,localectl, and/etc/default/locale - Ensure proper locale to avoid errors in system messages or software
βοΈ Real-world relevance: Crucial for applications like web servers, automation, scheduled scripts, and multi-user Raspberry Pi setups.
β FAQs β Timezone & Locale on Raspberry Pi
β How do I check my Raspberry Piβs timezone?
β Use:
timedatectl
This shows timezone, sync status, and current date/time.
β Can I change locale without using raspi-config?
β Yes. Use:
sudo dpkg-reconfigure locales
Or manually edit /etc/default/locale.
β Why is my keyboard layout incorrect?
β Likely a mismatch between the physical keyboard and configured layout. Fix it using:
sudo raspi-config β Localisation Options β Keyboard
β Do I need internet to set timezone or locale?
β
No. You can configure these offline. However, time synchronization (timedatectl) requires internet.
β What happens if I skip setting locale during setup?
β
You may see warnings or incorrect display formats. Always set at least one UTF-8 locale (e.g., en_US.UTF-8).
Share Now :
