1CONVDATE(1)               InterNetNews Documentation               CONVDATE(1)
2
3
4

NAME

6       convdate - Convert to/from RFC 5322 dates and seconds since epoch
7

SYNOPSIS

9       convdate [-dhl] [-c | -n | -s] [date ...]
10

DESCRIPTION

12       convdate translates the date/time strings given on the command line,
13       outputting the results one to a line.  The input can either be a date
14       in RFC 5322 format (accepting the variations on that format that
15       innd(8) is willing to accept), or the number of seconds since epoch (if
16       -c is given).  The output is either ctime(3) results, the number of
17       seconds since epoch, or a Usenet Date header field body, depending on
18       the options given.
19
20       If date is not given, convdate outputs the current date.
21

OPTIONS

23       -c  Each argument is taken to be the number of seconds since epoch (a
24           time_t) rather than a date.
25
26       -d  Output a valid Usenet Date header field body instead of the results
27           of ctime(3) for each date given on the command line.  This is
28           useful for testing the algorithm used to generate Date header field
29           bodies for local posts.  Normally, the date will be in UTC, but see
30           the -l option.
31
32       -h  Print usage information and exit.
33
34       -l  Only makes sense in combination with -d.  If given, Date header
35           field bodies generated will use the local time zone instead of UTC.
36
37       -n  Rather than outputting the results of ctime(3) or a Date header
38           field body, output each date given as the number of seconds since
39           epoch (a time_t).  This option doesn't make sense in combination
40           with -d.
41
42       -s  Pass each given date to the RFC 5322 date parser and print the
43           results of ctime(3) (or a Date header field body if -d is given).
44           This is the default behavior.
45

EXAMPLES

47       Most of these examples are taken, with modifications from the original
48       man page dating from 1991 and were run in the EST/EDT time zone.
49
50           % convdate '10 Feb 1991 10:00:00 -0500'
51           Sun Feb 10 10:00:00 1991
52
53           % convdate '13 Dec 91 12:00 EST' '04 May 1990 0:0:0'
54           Fri Dec 13 12:00:00 1991
55           Fri May  4 00:00:00 1990
56
57           % convdate -n '10 feb 1991 10:00' '4 May 90 12:00'
58           666198000
59           641880000
60
61           % convdate -c 666198000
62           Sun Feb 10 10:00:00 1991
63
64       ctime(3) results are in the local time zone.  Compare to:
65
66           % convdate -dc 666198000
67           Sun, 10 Feb 1991 15:00:00 -0000 (UTC)
68
69           % env TZ=PST8PDT convdate -dlc 666198000
70           Sun, 10 Feb 1991 07:00:00 -0800 (PST)
71
72           % env TZ=EST5EDT convdate -dlc 666198000
73           Sun, 10 Feb 1991 10:00:00 -0500 (EST)
74
75       The system library functions generally use the environment variable TZ
76       to determine (or at least override) the local time zone.
77

HISTORY

79       Written by Rich $alz <rsalz@uunet.uu.net>, rewritten and updated by
80       Russ Allbery <eagle@eyrie.org> for the -d and -l flags.
81

SEE ALSO

83       active.times(5).
84
85
86
87INN 2.7.1                         2022-07-10                       CONVDATE(1)
Impressum