Categories: How-To

tzselect command on Linux (configure zone) [Basic Guide]

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. 
1) Atlantic Islands
2) Pará (east); Amapá
3) Brazil (northeast: MA, PI, CE, RN, PB)
4) Pernambuco
5) Tocantins
6) Alagoas, Sergipe
7) Bahia
8) Brazil (southeast) (...)

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

The following information has been given: 
Brazil
Brazil (southeast: GO, DF, MG, ES, RJ, SP, PR, SC, RS)
Therefore TZ='America/Sao_Paulo' will be used.
Selected time is now:Sat Oct 19 11:56:56 -03 2019.
Universal Time is now:Sat Oct 19 14:56:56 UTC 2019.
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

Uirá Endy Ribeiro

Uirá Endy Ribeiro is a Software Developer and Cloud Computing Architect with a 23-year career. He has master's degrees in computer science and fifteen IT certifications and is the author of 11 books recognized in the IT world market. He is also Director at Universidade Salgado de Oliveira and Director of the Linux Professional Institute - LPI Director's Board.

Uirá Endy Ribeiro

Uirá Endy Ribeiro is a Software Developer and Cloud Computing Architect with a 23-year career. He has master's degrees in computer science and fifteen IT certifications and is the author of 11 books recognized in the IT world market. He is also Director at Universidade Salgado de Oliveira and Director of the Linux Professional Institute - LPI Director's Board.

Recent Posts

Sudo command on Linux (privilege scale) [Basic Guide]

The sudo command on Linux executes a given command as if it were another user.…

2 years ago

SS command on Linux (investigate the network) [Basic Guide]

The ss command on Linux is extremely useful for investigating sockets, providing various information about…

2 years ago

Free Linux command (memory usage) [Basic Guide]

Free Linux command shows the amount of total memory in use and available, as well…

2 years ago

Linux while command (loop – while) [Basic Guide]

The shell has structures for testing conditions and executing certain program sequences several times (loop),…

2 years ago

Linux fstab file (disk mount setup) [Basic Guide]

The /etc/fstab file stores the configuration of which devices should be mounted and what is…

2 years ago

Netcat command on Linux (Swiss network knife) [Basic Guide]

The Netcat Command in Linux or nc is a utility used to do “almost anything”…

2 years ago

This website uses cookies.