author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sat, 25 Sep 2010 23:35:57 +0300 | |
changeset 557 | 6018b95541d9 |
parent 108 | aab18e67e03b |
child 731 | 58920092b506 |
permissions | -rw-r--r-- |
35 | 1 |
-*- outline -*- |
2 |
||
106
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
3 |
* System timer and system time. |
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
4 |
|
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
5 |
** Windows. |
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
6 |
|
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
7 |
Windows assume that system timer display locale time. |
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
8 |
|
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
9 |
** Debian. |
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
10 |
|
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
11 |
UTC=no - system timer display locale time, UTC=yes - UTC time. |
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
12 |
|
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
13 |
$ cat /etc/default/rcS |
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
14 |
UTC=no |
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
15 |
or |
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
16 |
UTC=yes |
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
17 |
|
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
18 |
If system dual boot with Windows you must set UTC=no. |
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
19 |
|
35 | 20 |
* Getting current date/time. |
21 |
||
22 |
$ date +"%Y-%m-%d %H:%M:%S" |
|
23 |
||
24 |
* Setting current date/time. |
|
25 |
||
26 |
$ sudo date --set="2009-02-22 12:12:00" +"%Y-%m-%d %H:%M:%S" |
|
27 |
||
36
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
28 |
Or set utc time: |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
29 |
|
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
30 |
$ sudo date --utc --set="2009-02-22 12:12:00" +"%Y-%m-%d %H:%M:%S" |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
31 |
|
38
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
32 |
May be prefer use ntpdate(8) command. |
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
33 |
|
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
34 |
* Get timezone. |
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
35 |
|
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
36 |
System wide configuration: |
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
37 |
|
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
38 |
$ cat /etc/timezone |
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
39 |
|
106
7713baac72b5
System timer and system time.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
40 |
* Get list of supported timezone. |
38
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
41 |
|
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
42 |
$ tzselect |
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
43 |
|
77d9646ec70b
Explore timezone theme.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
36
diff
changeset
|
44 |
* Set timezone. |
36
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
45 |
|
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
46 |
$ sudo tzconfig |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
47 |
Your current time zone is set to Europe/Kiev |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
48 |
Do you want to change that? [n]: y |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
49 |
|
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
50 |
Please enter the number of the geographic area in which you live: |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
51 |
|
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
52 |
1) Africa 7) Australia |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
53 |
2) America 8) Europe |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
54 |
3) US time zones 9) Indian Ocean |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
55 |
4) Canada time zones 10) Pacific Ocean |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
56 |
5) Asia 11) Use System V style time zones |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
57 |
6) Atlantic Ocean 12) None of the above |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
58 |
|
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
59 |
Number: 8 |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
60 |
|
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
61 |
Then you will be shown a list of cities which represent the time zone |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
62 |
in which they are located. You should choose a city in your time zone. |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
63 |
|
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
64 |
Amsterdam Andorra Athens Belfast Belgrade Berlin Bratislava Brussels |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
65 |
Bucharest Budapest Chisinau Copenhagen Dublin Gibraltar Guernsey Helsinki |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
66 |
Isle_of_Man Istanbul Jersey Kaliningrad Kiev Lisbon Ljubljana London |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
67 |
Luxembourg Madrid Malta Mariehamn Minsk Monaco Moscow Nicosia Oslo Paris |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
68 |
Podgorica Prague Riga Rome Samara San_Marino Sarajevo Simferopol Skopje |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
69 |
Sofia Stockholm Tallinn Tirane Tiraspol Uzhgorod Vaduz Vatican Vienna |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
70 |
Vilnius Volgograd Warsaw Zagreb Zaporozhye Zurich |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
71 |
|
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
72 |
Please enter the name of one of these cities or zones |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
73 |
You just need to type enough letters to resolve ambiguities |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
74 |
Press Enter to view all of them again |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
75 |
|
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
76 |
Name: [] Kiev |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
77 |
|
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
78 |
Your default time zone is set to 'Europe/Kiev'. |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
79 |
Local time is now: Sun Feb 22 12:40:16 EET 2009. |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
80 |
Universal Time is now: Sun Feb 22 10:40:16 UTC 2009. |
d9f385e0aa04
How setup timezone.
"Oleksandr Gavenko <gavenkoa@gmail.com>"
parents:
35
diff
changeset
|
81 |
Your current time zone is set to Europe/Kiev |
74 | 82 |
|
83 |
Or using tzselect: |
|
84 |
||
85 |
$ sudo tzselect |
|
86 |
Please identify a location so that time zone rules can be set correctly. |
|
87 |
Please select a continent or ocean. |
|
88 |
1) Africa |
|
89 |
2) Americas |
|
90 |
3) Antarctica |
|
91 |
4) Arctic Ocean |
|
92 |
5) Asia |
|
93 |
6) Atlantic Ocean |
|
94 |
7) Australia |
|
95 |
8) Europe |
|
96 |
9) Indian Ocean |
|
97 |
10) Pacific Ocean |
|
98 |
11) none - I want to specify the time zone using the Posix TZ format. |
|
99 |
#? 8 |
|
100 |
Please select a country. |
|
101 |
1) Aaland Islands 18) Greece 35) Norway |
|
102 |
2) Albania 19) Guernsey 36) Poland |
|
103 |
3) Andorra 20) Hungary 37) Portugal |
|
104 |
4) Austria 21) Ireland 38) Romania |
|
105 |
5) Belarus 22) Isle of Man 39) Russia |
|
106 |
6) Belgium 23) Italy 40) San Marino |
|
107 |
7) Bosnia & Herzegovina 24) Jersey 41) Serbia |
|
108 |
8) Britain (UK) 25) Latvia 42) Slovakia |
|
109 |
9) Bulgaria 26) Liechtenstein 43) Slovenia |
|
110 |
10) Croatia 27) Lithuania 44) Spain |
|
111 |
11) Czech Republic 28) Luxembourg 45) Sweden |
|
112 |
12) Denmark 29) Macedonia 46) Switzerland |
|
113 |
13) Estonia 30) Malta 47) Turkey |
|
114 |
14) Finland 31) Moldova 48) Ukraine |
|
115 |
15) France 32) Monaco 49) Vatican City |
|
116 |
16) Germany 33) Montenegro |
|
117 |
17) Gibraltar 34) Netherlands |
|
118 |
#? 48 |
|
119 |
Please select one of the following time zone regions. |
|
120 |
1) most locations 3) Zaporozh'ye, E Lugansk |
|
121 |
2) Ruthenia 4) central Crimea |
|
122 |
#? 1 |
|
123 |
||
124 |
The following information has been given: |
|
125 |
||
126 |
Ukraine |
|
127 |
most locations |
|
128 |
||
129 |
Therefore TZ='Europe/Kiev' will be used. |
|
130 |
Local time is now: Mon Mar 30 17:25:21 EEST 2009. |
|
131 |
Universal Time is now: Mon Mar 30 14:25:21 UTC 2009. |
|
132 |
Is the above information OK? |
|
133 |
1) Yes |
|
134 |
2) No |
|
135 |
#? 1 |
|
136 |
||
137 |
You can make this change permanent for yourself by appending the line |
|
138 |
TZ='Europe/Kiev'; export TZ |
|
139 |
to the file '.profile' in your home directory; then log out and log in again. |
|
140 |
||
141 |
Here is that TZ value again, this time on standard output so that you |
|
142 |
can use the /usr/bin/tzselect command in shell scripts: |
|
143 |
Europe/Kiev |
|
101
551a197b656b
Set timezone on Lenny.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
144 |
|
551a197b656b
Set timezone on Lenny.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
145 |
** Debian Lenny. |
551a197b656b
Set timezone on Lenny.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
146 |
|
551a197b656b
Set timezone on Lenny.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
147 |
$ sudo dpkg-reconfigure tzdata |