From dtanke@gwdu60.gwdg.de  Mon Sep  4 13:03:56 2000
Return-Path: <dtanke@gwdu60.gwdg.de>
Received: from gwdu60.gwdg.de (gwdu60.gwdg.de [134.76.98.60])
	by hub.freebsd.org (Postfix) with ESMTP id 63E3D37B424
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  4 Sep 2000 13:03:55 -0700 (PDT)
Received: (from dtanke@localhost)
	by gwdu60.gwdg.de (8.9.3/8.9.3) id WAA41103;
	Mon, 4 Sep 2000 22:03:52 +0200 (CEST)
	(envelope-from dtanke)
Message-Id: <200009042003.WAA41103@gwdu60.gwdg.de>
Date: Mon, 4 Sep 2000 22:03:52 +0200 (CEST)
From: Dietmar Tanke <dtanke@gwdu60.gwdg.de>
Reply-To: dtanke@gwdu60.gwdg.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: date -v31d -v08m -v2000y
X-Send-Pr-Version: 3.2

>Number:         21039
>Category:       bin
>Synopsis:       date -v31d -v08m -v2000y
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 04 13:10:00 PDT 2000
>Closed-Date:    Mon Sep 4 14:55:25 PDT 2000
>Last-Modified:  Mon Sep 04 14:57:49 PDT 2000
>Originator:     Dietmar Tanke
>Release:        FreeBSD 4.1-RELEASE i386
>Organization:
University of G&umlo;ttingen, Germany
>Environment:
FreeBSD gwdu60.gwdg.de 4.1-RELEASE FreeBSD 4.1-RELEASE #0: Mon Aug  7 10:27:48 CEST 2000     root@gwdp98.gwdg.de:/usr/src/sys/compile/GWDU60  i386

	

>Description:
Date adjustment using the -v option seems not work for any date with
the 31th day of a month. Two examples. First one with a good result
and the second leads to an unexpected error. Is it a bug?

dtanke$ date -v30d -v08m -v2000y 
Wed Aug 30 21:27:24 CEST 2000

dtanke$ date -v31d -v08m -v2000y 
31d: Cannot apply date adjustment

This example with "31" works well with 4.1 RELEASE.

dtanke$ date  -jf "%d.%m.%Y" 31.08.2000
Do  31 Aug 2000 21:38:15 CEST

	

>How-To-Repeat:
Same results with 2.2.8, 3.2, 4.0 and 4.1 RELEASE.

	

>Fix:
I am no programmer, sorry.
	


>Release-Note:
>Audit-Trail:

From: Paul Herman <pherman@frenchfries.net>
To: Dietmar Tanke <dtanke@gwdu60.gwdg.de>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/21039: date -v31d -v08m -v2000y
Date: Mon, 4 Sep 2000 22:46:16 +0200 (CEST)

 On Mon, 4 Sep 2000, Dietmar Tanke wrote:
 
 > >Description:
 > Date adjustment using the -v option seems not work for any date with
 > the 31th day of a month. Two examples. First one with a good result
 > and the second leads to an unexpected error. Is it a bug?
 > 
 > dtanke$ date -v30d -v08m -v2000y 
 > Wed Aug 30 21:27:24 CEST 2000
 
 The order of the "-v"s are important.
 
 bash-2.03$ date -v8m -v31d -v2000y
 Thu Aug 31 22:45:03 CEST 2000
 
 Try it next month and it'll work no matter what the order.  :-)
 
 -Paul.
 
 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Mon Sep 4 14:55:25 PDT 2000 
State-Changed-Why:  
As Paul says, the -v options are processed in the order given 
(as mentioned in the man page).  Doing things most-significant 
first will make things work for you. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21039 
>Unformatted:
