[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
new option --rfc-2822 for 'date'
From: |
Paul Eggert |
Subject: |
new option --rfc-2822 for 'date' |
Date: |
31 Jul 2003 14:21:02 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Internet RFC 2822 has superseded RFC 822, so GNU 'date' should support
its name as an alias. Here's a proposed patch. I also added some URLs
and fixed a typo in the format.
2003-07-31 Paul Eggert <address@hidden>
* NEWS: Add --rfc-2822 option to GNU date.
* doc/coreutils.texi (Time directives, Options for date, Examples
of date): Likewise.
* doc/getdate.texi (General date syntax): Likewise.
* src/date.c (long_options, usage, main): Likewise.
* doc/coreutils.texi (Options for date): Fix a typo in format:
it's now %d not %_d. Add URLs.
Index: NEWS
===================================================================
RCS file: /cvsroot/coreutils/coreutils/NEWS,v
retrieving revision 1.119
diff -p -u -r1.119 NEWS
--- NEWS 27 Jul 2003 20:45:55 -0000 1.119
+++ NEWS 31 Jul 2003 21:15:20 -0000
@@ -3,6 +3,8 @@ GNU coreutils NEWS
** New features
+ date accepts a new option --rfc-2822, an alias for --rfc-822.
+
sort is now up to 30% more CPU-efficient in some cases
`test' is now more compatible with Bash and POSIX:
Index: doc/coreutils.texi
===================================================================
RCS file: /cvsroot/coreutils/coreutils/doc/coreutils.texi,v
retrieving revision 1.126
diff -p -u -r1.126 coreutils.texi
--- doc/coreutils.texi 29 Jul 2003 18:20:56 -0000 1.126
+++ doc/coreutils.texi 31 Jul 2003 21:16:21 -0000
@@ -10537,7 +10537,7 @@ time, 24-hour (hh:mm:ss)
@item %X
locale's time representation (%H:%M:%S)
@item %z
-RFC-822 style numeric time zone (e.g., -0600 or +0100), or nothing if no
+RFC-2822 style numeric time zone (e.g., -0600 or +0100), or nothing if no
time zone is determinable. This value reflects the @emph{current} time
zone. It isn't changed by the @option{--date} option.
@item %Z
@@ -10782,10 +10782,22 @@ argument; use @option{--iso-8601} instea
@item -R
@itemx --rfc-822
address@hidden --rfc-2822
@opindex -R
@opindex --rfc-822
-Display the time and date using the RFC-822-conforming
-format, @samp{%a, %_d %b %Y %H:%M:%S %z}.
address@hidden --rfc-2822
+Display the time and date using the format @samp{%a, %d %b %Y %H:%M:%S
+%z}, evaluated in the C locale so abbreviations are always in English.
+For example:
+
address@hidden
+Fri,@ @ 1 Aug 2003 23:05:56 -0700
address@hidden example
+
+This format conforms to
address@hidden://ftp.rfc-editor.org/in-notes/rfc2822.txt, RFC 2822} and
address@hidden://ftp.rfc-editor.org/in-notes/rfc822.txt, RFC 822}, the
+current and previous standards for Internet email.
@item -r @var{file}
@itemx address@hidden
@@ -10880,11 +10892,11 @@ date --set='+2 minutes'
@end example
@item
-To print the date in the format specified by RFC-822,
-use @samp{date --rfc}. I just did and saw this:
+To print the date in the format specified by RFC-2822,
+use @samp{date --rfc-2822}. I just did and saw this:
@example
-Mon, 25 Mar 1996 23:34:17 -0600
+Thu, 31 Jul 2003 13:13:05 -0700
@end example
@anchor{%s-examples}
Index: doc/getdate.texi
===================================================================
RCS file: /cvsroot/coreutils/coreutils/doc/getdate.texi,v
retrieving revision 1.20
diff -p -u -r1.20 getdate.texi
--- doc/getdate.texi 27 May 2002 20:05:03 -0000 1.20
+++ doc/getdate.texi 31 Jul 2003 21:16:22 -0000
@@ -122,7 +122,7 @@ $ TZ=UTC0 date +"%Y-%m-%d %H:%M:%SZ"
2000-12-15 19:48:05Z
$ date --iso-8601=seconds # a GNU extension
2000-12-15T11:48:05-0800
-$ date --rfc-822 # a GNU extension
+$ date --rfc-2822 # a GNU extension
Fri, 15 Dec 2000 11:48:05 -0800
$ date +"%Y-%m-%d %H:%M:%S %z" # %z is a GNU extension.
2000-12-15 11:48:05 -0800
Index: src/date.c
===================================================================
RCS file: /cvsroot/coreutils/coreutils/src/date.c,v
retrieving revision 1.127
diff -p -u -r1.127 date.c
--- src/date.c 23 Jul 2003 07:29:54 -0000 1.127
+++ src/date.c 31 Jul 2003 21:16:23 -0000
@@ -86,6 +86,7 @@ static struct option const long_options[
{"iso-8601", optional_argument, NULL, 'I'},
{"reference", required_argument, NULL, 'r'},
{"rfc-822", no_argument, NULL, 'R'},
+ {"rfc-2822", no_argument, NULL, 'R'},
{"set", required_argument, NULL, 's'},
{"uct", no_argument, NULL, 'u'},
{"utc", no_argument, NULL, 'u'},
@@ -133,7 +134,7 @@ Display the current time in the given FO
"), stdout);
fputs (_("\
-r, --reference=FILE display the last modification time of FILE\n\
- -R, --rfc-822 output RFC-822 compliant date string\n\
+ -R, --rfc-2822 output RFC-2822 compliant date string\n\
-s, --set=STRING set time described by STRING\n\
-u, --utc, --universal print or set Coordinated Universal Time\n\
"), stdout);
@@ -204,7 +205,7 @@ specifies Coordinated Universal Time. I
%Y year (1970...)\n\
"), stdout);
fputs (_("\
- %z RFC-822 style numeric timezone (-0500) (a nonstandard extension)\n\
+ %z RFC-2822 style numeric timezone (-0500) (a nonstandard extension)\n\
%Z time zone (e.g., EDT), or nothing if no time zone is determinable\n\
\n\
By default, date pads numeric fields with zeroes. GNU date recognizes\n\
@@ -392,12 +393,12 @@ argument must be a format string beginni
usage (EXIT_FAILURE);
}
- /* Simply ignore --rfc-822 if specified when setting the date. */
+ /* Simply ignore --rfc-2822 if specified when setting the date. */
if (rfc_format && !set_date && n_args > 0)
{
error (0, 0,
_("a format string may not be specified when using\
- the --rfc-822 (-R) option"));
+ the --rfc-2822 (-R) option"));
usage (EXIT_FAILURE);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- new option --rfc-2822 for 'date',
Paul Eggert <=