Set debian Linux Timezone via command line
This works on Linux Mint, Ubuntu, Debian, I think most Debian-based distros...
echo "America/Eastern" | sudo tee /etc/timezone
sudo dpkg-reconfigure --frontend noninteractive tzdata
Where to find timezones:
- See this Wikipedia link on the tz database for other timezones to use
- Sources for Time Zone and Daylight Saving Time Data lists more sources, like TWiki.org Service: Date and Time Gateway - Timezone Selector
- Looking at
/usr/share/zoneinfo/
shows zones that should work. Most are "Country/City" in "folder/folder" format, but if you pick a "plain" zone like MST, it may not set the daylight savings time info.
Or (as commented) use timedatectl list-timezones
to find a zone, then timedatectl set-timezone [timezone]
If required, see this Debian page about Time Zone Changes. You could use the program zic
along with changing some files, if you wanted to change the details of the time zone, like daylight savings time start & end dates, etc.
You can change it with more than one line. Exactly two lines.
mv /etc/localtime /etc/localtime.old
and then Link your TimeZone file like this:
ln -s /usr/share/zoneinfo/Europa/London /etc/localtime
You can check with date