* Romain Francoise <rfranco...@debian.org> [2024-03-17 19:52]:
>
> tcpdump has no special handling of TZ, it just calls strftime() which
> handles TZ as described in strftime(3).

Thanks for the quick feedback.

That’s a bit tricky one then. Users of tcpdump wouldn’t generally know
that strftime() is in use and thus don’t know to visit that man
page.

To investigate what’s done conventionally, I ran this command:

  $ man -IaK --regex TZ | sed -ne '/\<TZ\>.*zone/{x;G;p};/^NAME/{N;s/\n/ /;h}'

which short-listed some pages. Of those, “man tree” shows a good
complete example. It contains:

===8<----------------------------------------
ENVIRONMENT
       LS_COLORS      Color information created by dircolors
       TREE_COLORS    Uses this for color information over LS_COLORS if it is 
set.
       TREE_CHARSET   Character set for tree to use in HTML mode.
       CLICOLOR       Enables colorization even if TREE_COLORS or LS_COLORS is 
not set.
       CLICOLOR_FORCE Always enables colorization (effectively -C)
       LC_CTYPE       Locale for filename output.
       LC_TIME        Locale for timefmt output, see strftime(3).
       TZ             Timezone for timefmt output, see strftime(3).
…
SEE ALSO
       dircolors(1), ls(1), find(1), du(1), strftime(3)
===8<----------------------------------------

But if tcpdump were to document the TZ variable and strftime() were to
make a change so TZ no longer has effect, then tcpdump would have to
keep tabs on strftime(), in principle. OTOH, the “see strftime(3)” gives
users enough info to react if that happens.

Alternatively, a minimal change would be to add strftime(3) to the SEE ALSO
section. The current tcpdump man page misses it:

===8<----------------------------------------
SEE ALSO
       stty(1), pcap(3PCAP), bpf(4), nit(4P), pcap-savefile(5), pcap-filter(7), 
pcap-tstamp(7)
===8<----------------------------------------

Reply via email to