From nobody@FreeBSD.org  Mon Jan  8 16:28:28 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id F0FA037B401
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  8 Jan 2001 16:28:27 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f090SRE88775;
	Mon, 8 Jan 2001 16:28:27 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200101090028.f090SRE88775@freefall.freebsd.org>
Date: Mon, 8 Jan 2001 16:28:27 -0800 (PST)
From: taz@lagmonster.org
To: freebsd-gnats-submit@FreeBSD.org
Subject: Allow Date to generate an RFC-822 Compliant output.
X-Send-Pr-Version: www-1.0

>Number:         24166
>Category:       misc
>Synopsis:       Allow Date to generate an RFC-822 Compliant output.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 08 16:30:01 PST 2001
>Closed-Date:    Thu Jun 14 03:16:46 PDT 2001
>Last-Modified:  Thu Jun 14 03:18:33 PDT 2001
>Originator:     David Alexander
>Release:        4.2
>Organization:
Lagmonster Org.
>Environment:
No problems.
>Description:
It would be nice to have Date generate (perhaps with a -R switch) an RFC-822 formatted output. It would be nice to be able to offset it. (I am looking for a non-converted format to push cookies and other HTTP standard date format uses.
>How-To-Repeat:
N/A
>Fix:
Unknown

>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@orbitel.bg>
To: taz@lagmonster.org
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/24166: Allow Date to generate an RFC-822 Compliant output.
Date: Tue, 9 Jan 2001 09:35:49 +0200

 On Mon, Jan 08, 2001 at 04:28:27PM -0800, taz@lagmonster.org wrote:
 > 
 > >Number:         24166
 > >Category:       misc
 > >Synopsis:       Allow Date to generate an RFC-822 Compliant output.
 > >Originator:     David Alexander
 > >Release:        4.2
 > >Organization:
 > Lagmonster Org.
 > >Environment:
 > No problems.
 > >Description:
 > It would be nice to have Date generate (perhaps with a -R switch) an RFC-822
 > formatted output. It would be nice to be able to offset it. (I am looking for
 > a non-converted format to push cookies and other HTTP standard date format
 > uses.
 
 If you mean date(1) (/bin/date), it can generate output in any format you
 specify.  See the date(1) and strftime(3) manpages (strftime.3 is referenced
 in the SEE ALSO section of date.1).  For RFC-822 compliant output, use:
 
 date '+%a, %e %b %Y %T %z (%Z)'
 
 You could even make a tiny shell script to do that, if you don't want all
 those format chars in the way:
 
 #!/bin/sh
 exec /bin/date '+%a, %e %b %Y %T %z (%Z)'
 
 Does that suffice? :)
 
 G'luck,
 Peter
 
 -- 
 What would this sentence be like if pi were 3?
 

From: Peter Pentchev <roam@orbitel.bg>
To: taz@lagmonster.org
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/24166: Allow Date to generate an RFC-822 Compliant output.
Date: Fri, 30 Mar 2001 15:32:44 +0300

 I don't see too many people interested in such new functionality
 in date(1); however, you could try the attached patch on your
 local systems (it is against -current, but applies cleanly to -stable).
 
 G'luck,
 Peter
 
 -- 
 This sentence claims to be an Epimenides paradox, but it is lying.
 
 
 On Mon, Jan 08, 2001 at 11:40:03PM -0800, Peter Pentchev wrote:
 > The following reply was made to PR misc/24166; it has been noted by GNATS.
 > 
 > From: Peter Pentchev <roam@orbitel.bg>
 > To: taz@lagmonster.org
 > Cc: freebsd-gnats-submit@FreeBSD.org
 > Subject: Re: misc/24166: Allow Date to generate an RFC-822 Compliant output.
 > Date: Tue, 9 Jan 2001 09:35:49 +0200
 > 
 >  On Mon, Jan 08, 2001 at 04:28:27PM -0800, taz@lagmonster.org wrote:
 >  > 
 >  > >Number:         24166
 >  > >Category:       misc
 >  > >Synopsis:       Allow Date to generate an RFC-822 Compliant output.
 >  > >Originator:     David Alexander
 >  > >Release:        4.2
 >  > >Organization:
 >  > Lagmonster Org.
 >  > >Environment:
 >  > No problems.
 >  > >Description:
 >  > It would be nice to have Date generate (perhaps with a -R switch) an RFC-822
 >  > formatted output. It would be nice to be able to offset it. (I am looking for
 >  > a non-converted format to push cookies and other HTTP standard date format
 >  > uses.
 >  
 >  If you mean date(1) (/bin/date), it can generate output in any format you
 >  specify.  See the date(1) and strftime(3) manpages (strftime.3 is referenced
 >  in the SEE ALSO section of date.1).  For RFC-822 compliant output, use:
 >  
 >  date '+%a, %e %b %Y %T %z (%Z)'
 >  
 >  You could even make a tiny shell script to do that, if you don't want all
 >  those format chars in the way:
 >  
 >  #!/bin/sh
 >  exec /bin/date '+%a, %e %b %Y %T %z (%Z)'
 >  
 >  Does that suffice? :)
 
 Index: src/bin/date/date.1
 ===================================================================
 RCS file: /home/ncvs/src/bin/date/date.1,v
 retrieving revision 1.51
 diff -u -r1.51 date.1
 --- src/bin/date/date.1	2001/03/16 02:20:24	1.51
 +++ src/bin/date/date.1	2001/03/30 12:27:27
 @@ -43,7 +43,7 @@
  .Nd display or set date and time
  .Sh SYNOPSIS
  .Nm
 -.Op Fl jnu
 +.Op Fl Rjnu
  .Op Fl d Ar dst
  .Op Fl r Ar seconds
  .Op Fl t Ar minutes_west
 @@ -86,6 +86,8 @@
  .Pp
  The options are as follows:
  .Bl -tag -width Ds
 +.It Fl R
 +Print the date in RFC-822 format.
  .It Fl d Ar dst
  Set the kernel's value for daylight saving time.
  If
 Index: src/bin/date/date.c
 ===================================================================
 RCS file: /home/ncvs/src/bin/date/date.c,v
 retrieving revision 1.35
 diff -u -r1.35 date.c
 --- src/bin/date/date.c	2000/08/16 05:14:49	1.35
 +++ src/bin/date/date.c	2001/03/30 12:27:28
 @@ -80,6 +80,7 @@
  {
  	struct timezone tz;
  	int ch, rflag;
 +	int Rflag;
  	int jflag, nflag;
  	char *format, buf[1024];
  	char *endptr, *fmt;
 @@ -92,11 +93,15 @@
  	fmt = NULL;
  	(void) setlocale(LC_TIME, "");
  	tz.tz_dsttime = tz.tz_minuteswest = 0;
 +	Rflag = 0;
  	rflag = 0;
  	jflag = nflag = 0;
  	set_timezone = 0;
 -	while ((ch = getopt(argc, argv, "d:f:jnr:t:uv:")) != -1)
 +	while ((ch = getopt(argc, argv, "Rd:f:jnr:t:uv:")) != -1)
  		switch((char)ch) {
 +		case 'R':
 +			Rflag = 1;
 +			break;
  		case 'd':		/* daylight savings time */
  			tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0;
  			if (endptr == optarg || *endptr != '\0')
 @@ -146,7 +151,10 @@
  	if (!rflag && time(&tval) == -1)
  		err(1, "time");
  
 -	format = "%+";
 +	if (!Rflag)
 +		format = "%+";
 +	else
 +		format = "%a, %e %b %Y %T %z (%Z)";
  
  	/* allow the operands in any order */
  	if (*argv && **argv == '+') {
State-Changed-From-To: open->closed 
State-Changed-By: schweikh 
State-Changed-When: Thu Jun 14 03:16:46 PDT 2001 
State-Changed-Why:  
Committed maintainer change. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=24166 
>Unformatted:
