Date: Thu, 3 Jun 2010 08:21:06 GMT From: brian@FreeBSD.org To: brian@FreeBSD.org, freebsd-bugs@FreeBSD.org, brian@FreeBSD.org Subject: Re: bin/147354: date(1) doesn't show the number of the last day of the year Message-ID: <201006030821.o538L6sp067606@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006030821.o538L6sp067606>