Skip to content

tzselect command on Linux (configure zone)

The tzselect command on Linux can be used to choose the time zone zone and show the correct value for the variable TZ.

Its operation is simple: you must first choose the continent:

# tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, “coord”, or “TZ”.
1) Africa 7) Europe
2) Americas 8) Indian Ocean
3) Antarctica 9) Pacific Ocean
4) Asia 10) geographical coordinates
5) Atlantic Ocean 11) TZ
6) Australia

Then you must choose the country:

Please select a country whose clocks agree with yours.
1) Eel 12) Cayman Islands
2) Antigua 13) Chile
3) Argentina 14) Colombia
4) Aruba 15) Costa Rica
5) Bahamas 16) Cuba
6) Barbados 17) Curacao
7) Belize 18) Dominica
8) Bolivia 19) Dominican Republic
9) Brazil 20) Ecuador
(...)

And finally the Time Zone:

Please select one of the following timezones. <br></br>1) Atlantic Islands <br></br>2) Pará (east); Amapá <br></br>3) Brazil (northeast: MA, PI, CE, RN, PB) <br></br>4) Pernambuco <br></br>5) Tocantins <br></br>6) Alagoas, Sergipe <br></br>7) Bahia <br></br>8) Brazil (southeast)
(...)

Once the desired Time Zone is selected, tzselect asks you to confirm the settings:

The following information has been given: <br></br>Brazil <br></br>Brazil (southeast: GO, DF, MG, ES, RJ, SP, PR, SC, RS) <br></br>Therefore TZ='America/Sao_Paulo' will be used. <br></br>Selected time is now:Sat Oct 19 11:56:56 -03 2019. <br></br>Universal Time is now:Sat Oct 19 14:56:56 UTC 2019. <br></br>Is the above information OK?
  1. Yes
  2. No And then it creates the command line for configuring the TZ variable and also indicates where it should be saved:
You can make this change permanent for yourself by appending the linetz='America/Sao_Paulo'; export TzTo the file '.profile' in your home directory; then log out and log in again.

Learn much more about Linux in our online course. You can register here. If you already have an account, or want to create one, just log in or create your user here.

Did you like it?

Share