summaryrefslogtreecommitdiff
path: root/doc/s6-tai64nlocal.html
blob: 8bfa04140c0a682ab7c85584e630f4a1ea55fac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="en" />
    <title>s6: the s6-tai64nlocal program</title>
    <meta name="Description" content="s6: the s6-tai64nlocal program" />
    <meta name="Keywords" content="s6 command s6-tai64nlocal filter timestamp TAI64 TAI64N human-readable date time" />
    <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
  </head>
<body>

<p>
<a href="index.html">s6</a><br />
<a href="//skarnet.org/software/">Software</a><br />
<a href="//skarnet.org/">skarnet.org</a>
</p>

<h1> The s6-tai64nlocal program </h1>

<p>
s6-tai64nlocal acts as a filter, reading from stdin and writing to stdout.
For every line that begins with a
<a href="//skarnet.org/software/skalibs/libstddjb/tai.html#timestamp">TAI64N
timestamp</a>, it replaces this timestamp with a human-readable local date and
time.
</p>

<h2> Interface </h2>

<pre>
     s6-tai64nlocal [ -g ]
</pre>

<ul>
 <li> s6-tai64nlocal exits 0 when it sees the end of stdin. If there's an
unfinished line, s6-tai64nlocal processes it
and writes it before exiting. </li>
</ul>

<h2> Options </h2>

<ul>
 <li> <tt>-g</tt>&nbsp;: print GMT time instead of local time. </li>
</ul>

<h2> Notes </h2>

<ul>
 <li> The typical use case of s6-tai64nlocal is to read files that have
been filtered through <a href="s6-tai64n.html">s6-tai64n</a>, or log files
that have been produced by <a href="s6-log.html">s6-log</a> with the <tt>-t</tt>
option. For instance, to read the latest httpd logs with human-readable
timestamps, <tt>s6-tai64nlocal &lt; /var/log/httpd/current | less</tt> is a
possible command. </li>
 <li> s6-tai64nlocal does neither "line buffering" nor "block buffering". It does
<em>optimal buffering</em>, i.e. it flushes its output buffer every time
it risks blocking on input. </li>
</ul>

<h2> Troubleshooting </h2>

<p>
 If s6-tai64nlocal does not appear to give the correct local time:
</p>

<ul>
 <li> Check the compilation options that were used for the
<a href="//skarnet.org/software/skalibs/">skalibs</a> libraries
your s6-tai64nlocal program was linked against. In particular, check whether the
<tt>--enable-tai-clock</tt> or <tt>--enable-right-tz</tt> configure options
have been given. </li>
 <li> Compare these flags and their meanings with your current timezone. In particular,
check <tt>/etc/localtime</tt>, <tt>/etc/timezone</tt>, <tt>/etc/TZ</tt>, and the TZ
environment variable. </li>
</ul>

</body>
</html>