From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 3 08:21:07 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E0BB1065674; Thu, 3 Jun 2010 08:21:07 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F30A08FC08; Thu, 3 Jun 2010 08:21:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o538L68L067618; Thu, 3 Jun 2010 08:21:06 GMT (envelope-from brian@freefall.freebsd.org) Received: (from brian@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o538L6sp067606; Thu, 3 Jun 2010 08:21:06 GMT (envelope-from brian) Date: Thu, 3 Jun 2010 08:21:06 GMT Message-Id: <201006030821.o538L6sp067606@freefall.freebsd.org> To: brian@FreeBSD.org, freebsd-bugs@FreeBSD.org, brian@FreeBSD.org From: brian@FreeBSD.org Cc: Subject: Re: bin/147354: date(1) doesn't show the number of the last day of the year X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2010 08:21:07 -0000 Synopsis: date(1) doesn't show the number of the last day of the year Responsible-Changed-From-To: freebsd-bugs->brian Responsible-Changed-By: brian Responsible-Changed-When: Thu Jun 3 08:14:47 UTC 2010 Responsible-Changed-Why: I wrote this code... The -v switch in date(1) is intended to work this way; it applies the adjustments in order. So, while 'date -v31d -v12m' won't work when the current month has less than 31 days, 'date -v12m -v31d' will always work. The rationalle behind this is that because adjustments may be relative rather than absolute (or may even be a mixture), they must be applied in order. For example, to find the last day of February, 2012 you can use 'date -v1d -v3m -v2012y -v-1d +%d', and the arguments are not commutitive. http://www.freebsd.org/cgi/query-pr.cgi?pr=147354