Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jul 1997 20:49:28 +0100
From:      Brian Somers <brian@awfulhak.org>
To:        freebsd-hackers@FreeBSD.org
Subject:   date(1)
Message-ID:  <199707281949.UAA21778@awfulhak.org>

next in thread | raw e-mail | index | archive | help
Hi,

I'd like to add the following functionality to date(1) in -current,
and eventually backport it to RELENG_2_2.  The argument against is
that it introduces more cruft into /bin, but I think date(1) is the
correct place for it.

The following flags will "adjust" the displayed date:

-D [+|-]days
-M [+|-]months
-W [+|-]weekdays
-Y [+|-]years

Without the + or - before the given day/month/weekday/year, the
appropriate bit of the date will be set to the given value.  With
the + or -, the date will be adjusted by the given value.

For example, ``date -D1'' will output the date on the first of this
month, ``date -D1 -D-1'' will output the last day of last month,
``date -D1 -D-1 -W+saturday'' will output the date on the first
Saturday of this month and ``date -D1 -M+1 -W-fri'' will output
the last Friday of the month.

The flags are processed strictly in order.

The functionality can be used to provide arguments to programs and
would be *really* useful for archiving scripts.

Any objections or suggestions ?

-- 
Brian <brian@awfulhak.org>, <brian@freebsd.org>
      <http://www.awfulhak.org>;
Don't _EVER_ lose your sense of humour....





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707281949.UAA21778>