Find the Right Linux Timezone with tzselect
Before setting TZ on a server, use tzselect to find the exact IANA identifier, such as Europe/London, without touching the machine's actual timezone. The interactive check takes about two minutes. You need a shell and readable timezone data; you do not need root privileges.
The route
Jump straight to the step you need, or tick off Done means at the end.
What it does, and what it does not do
tzselect is a viewer and selector. It reads timezone data from /usr/share/zoneinfo/, asks questions in the terminal, and prints the selected TZ value. It does not set the system clock, change /etc/localtime, alter a service, or make the selection permanent.
That boundary makes it safe to explore. If you need to configure the host, stop after this guide and use your distribution's timezone configuration workflow: on Debian and Ubuntu, the installed manual page specifically points to dpkg-reconfigure tzdata. That is a separate operation and may affect applications that read the system timezone.
1. Confirm the local version
This guide was checked against Ubuntu's libc-bin package version 2.39-0ubuntu8.9. The command reports itself as GLIBC timezone data version 2.39. Check your own installation before relying on an example, because the available location names come from local data.
dpkg-query -W -f='${Package} ${Version}\n'
tzselect --version
Expected output on the checked machine is similar to this:
libc-bin 2.39-0ubuntu8.9
tzselect (Ubuntu GLIBC 2.39-0ubuntu8.9) 2.39
If dpkg-query is unavailable, run tzselect --version on its own. The version check is informational, not a requirement for starting the selector.
2. Start the selector and answer the menus
Run it with no positional argument. Prompts are written to the terminal, and your answers are read interactively:
tzselect
The first menu contains broad areas such as Africa, Americas, Asia and Europe. Enter the number beside the area, then press Enter. Selecting Europe, for example, produces a country menu; select a country, then a city or representative location when another menu appears.
Tip
Pressing Enter without a number reprints the current menu. That is useful if output has scrolled away, but it is also an easy way to think you are stuck. An invalid entry reprints the list too. Correct the input rather than adding shell syntax to the prompt, this is a menu, not a command line.
3. Read and verify the result
After the location choice, tzselect prints a proposed value and shows the selected local time alongside Universal Time. A normal result looks like this, with the date and clock values varying at runtime:
Therefore TZ='Europe/London' will be used.
Selected time is now: Sun Sep 27 14:26:50 BST 2026.
Universal Time is now: Sun Sep 27 13:26:50 UTC 2026.
Is the above information OK?
1) Yes
2) No
Checkpoint
Check the printed TZ name, not just the city label. A country can contain more than one civil-time region, and location labels guide selection rather than replace the timezone identifier. Compare the selected time with UTC to catch a wrong region or a daylight-saving expectation that does not match your target date.
At the final confirmation, choose Yes if the identifier is the one you need. Choosing No returns you to the selection flow, and Ctrl-C abandons the run at any point without changing anything on the host.
4. Capture the identifier for another command
The conversation is interactive, so do not redirect all output and expect a clean value. The script writes its final TZ assignment to standard output while its questions are displayed on standard error. The simplest reliable method is to complete the prompts normally and copy the quoted identifier from the final result.
Use that identifier as an input to a later command only after checking it. For example, this reads the time in London without changing the machine timezone:
TZ='Europe/London' date
This temporary environment assignment applies to that one date process. It does not edit a configuration file and disappears when the command finishes. Replace the example with the exact TZ value printed by your own selection.
5. Use coordinate-driven selection
This installed version also supports --help, --version, and coordinate-driven selection, which avoids browsing continent and country menus:
tzselect -c +4852+00220
The example uses ISO 6709-style degrees and minutes for a point near Paris. The script then offers nearby timezone locations. With -n, limit how many nearby locations it displays:
tzselect -c +4852+00220 -n 5
Only use coordinate input when you understand its sign convention: a leading plus or minus identifies north or south latitude and east or west longitude in the compact form. If that feels less clear than the menus, use ordinary interactive selection instead.
Common traps
- Expecting a permanent change. None is made. If you intended to configure the host, use the separate timezone administration command for your distribution and verify its plan before confirming.
- Choosing a country and stopping. The country is an intermediate menu. Continue until the tool prints a concrete
TZidentifier. - Trusting an old copied name. Inspect the current run's output and local
/usr/share/zoneinfo/data: location tables can differ between package versions. - Seeing a stale or confusing clock. The displayed time is a snapshot depending on the current date, timezone rules and the host's clock, not a promise that system time synchronisation is working.
- Needing to stop. Press
Ctrl-C. There is no state to undo becausetzselectis read-only.
Done means
- You know the installed
tzselectversion. - You selected a location and read the printed
TZidentifier. - You compared the selected time with Universal Time.
- You have not mistaken viewing a timezone for configuring the host.