author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Fri, 01 Jul 2011 21:56:16 +0300 | |
changeset 890 | 6f835a47d0e0 |
parent 734 | 384f90c63395 |
child 899 | 7b4265c8d324 |
permissions | -rw-r--r-- |
734 | 1 |
-*- mode: outline; coding: utf-8; fill-column: 80 -*- |
35 | 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 |
731 | 47 |
... |
74 | 48 |
|
49 |
Or using tzselect: |
|
50 |
||
51 |
$ sudo tzselect |
|
731 | 52 |
... |
101
551a197b656b
Set timezone on Lenny.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
53 |
|
551a197b656b
Set timezone on Lenny.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
54 |
** Debian Lenny. |
551a197b656b
Set timezone on Lenny.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
55 |
|
551a197b656b
Set timezone on Lenny.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
74
diff
changeset
|
56 |
$ sudo dpkg-reconfigure tzdata |
732
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
57 |
|
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
58 |
* About timestamp. |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
59 |
|
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
60 |
http://en.wikipedia.org/wiki/Timestamp |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
61 |
http://en.wikipedia.org/wiki/Unix_time |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
62 |
http://en.wikipedia.org/wiki/Leap_second |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
63 |
|
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
64 |
** Get timestamp. |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
65 |
|
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
66 |
Current timestamp: |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
67 |
|
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
68 |
$ date +%s |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
69 |
|
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
70 |
Timestamp for specific date/time: |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
71 |
|
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
72 |
$ date -d '2010-12-11' +%s |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
73 |
$ date -d '2010-12-11 23:59:59' +%s |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
74 |
|
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
75 |
** Convert unix timestamp to date. |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
76 |
|
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
77 |
$ date -d '1970-01-01 + 1234567890 seconds' |
93b95dfbdac1
About timestamp. Get timestamp. Convert unix timestamp to date.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
731
diff
changeset
|
78 |