2.4.1. Data e hora
Fuso horário
É imperativo configurar correctamente o fuso horário em que o servidor se encontra. A informação sobre o fuso horário encontra-se no ficheiro /etc/timezone:
server:~# cat /etc/timezone
Europe/Lisbon
Para configurar o fuso horário, utilizar o comando tzconfig e escolher a zona correcta, no menu interactivo:
server:~# tzconfig
Your current time zone is set to Europe/Paris
Do you want to change that? [n]: y
Please enter the number of the geographic area in which you live:
1) Africa 7) Australia
2) America 8) Europe
3) US time zones 9) Indian Ocean
4) Canada time zones 10) Pacific Ocean
5) Asia 11) Use System V style time zones
6) Atlantic Ocean 12) None of the above
Then you will be shown a list of cities which represent the time zone
in which they are located. You should choose a city in your time zone.
Number: 8
Amsterdam Andorra Athens Belfast Belgrade Berlin Bratislava Brussels
Bucharest Budapest Chisinau Copenhagen Dublin Gibraltar Guernsey Helsinki
Isle_of_Man Istanbul Jersey Kaliningrad Kiev Lisbon Ljubljana London
Luxembourg Madrid Malta Mariehamn Minsk Monaco Moscow Nicosia Oslo Paris
Podgorica Prague Riga Rome Samara San_Marino Sarajevo Simferopol Skopje
Sofia Stockholm Tallinn Tirane Tiraspol Uzhgorod Vaduz Vatican Vienna
Vilnius Volgograd Warsaw Zagreb Zaporozhye Zurich
Please enter the name of one of these cities or zones
You just need to type enough letters to resolve ambiguities
Press Enter to view all of them again
Name: [] Lisbon
Your default time zone is set to 'Europe/Lisbon'.
Local time is now: Seg Abr 23 16:23:39 WEST 2007.
Universal Time is now: Seg Abr 23 15:23:39 UTC 2007.
Acertar data e hora
O comando date mostra a data actual do sistema:
server:~# date
Seg Abr 23 16:09:01 WEST 2007
O comando date também permite acertar a hora do sistema manualmente, utilizando a sintaxe reduzida “date MMDDhhmm”:
server:~# date 04231608
Seg Abr 23 16:08:00 WEST 2007
Links relacionados
- Debian GNU/Linux System Administrator's Manual, Chapter 16 - Time (http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html)
Comentários
Add a new comment




















