What's the best approach for configuring the Time Zone non-interactively?
hostname, I've used
sudo raspi-config nonint do_hostname
However, I am unable to locate the equivalent command for
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
timedatectl - for example
sudo timedatectl set-timezone Australia/Sydney
The time zone is set by a symbolic link from
/etc/localtime to a file in the
The time zone needs to be in the form 'Area/Location' where these conform to the standards used in Linux. E.g. for Area use Africa, America, Antarctica, Arctic, Asia, Atlantic, Australia, Europe, Indian, and Pacific.
For Location use the name of a specific location within the Area. This is usually a city or small island.
See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for details
For example for New Zealand use Pacific/Auckland
/etc/timezonewill be overwritten.
The commands I run are;
sudo rm /etc/localtime sudo ln -s /usr/share/zoneinfo/Pacific/Auckland /etc/localtime sudo rm /etc/timezone
Edit: Now I'm looking at it I don't exactly know why I'm removing
timedatectl, abstractions are your friend.