Subject: Re: Problem with date command
To: Stefan Schumacher <stefan@net-tex.de>
From: None <ipt@scraemon.org>
List: netbsd-help
Date: 12/12/2004 16:23:17
On Sun, Dec 12, 2004 at 07:50:35PM +0000, Stefan Schumacher wrote:
> Also sprach Mark E. Perkins (perkinsm@bway.net)
> > On 12/12/04 12:20, ipt@scraemon.org wrote:
> > >The date command isn't giving output consistent with its man page. This
> > >command, 'date +%c/%m/%d', should display
> > >
> > > 2004/12/12
> > >
> > >instead it displays
> > >
> > > Sun Dec 12 11:57:24 2004/12/12
> > >
> > >This used to display correctly in versions past, although I don't
> > >remember which versions exactly. I'm running 2.0 right now.
> >
> > I can't comment on 2.0 behavior, since I don't have it running anywhere
> > just yet. But I tried this on 1.5.something and 1.6.2 and get the same
> > result that you did. I can get the result you *want* with 'date +%Y/%m/%d'
> > on both of those systems. My reading of the man page for strftime(3)
> > suggests that all is as it should be.
>
> Right, it shows the same dateformat, since STRFTIME(3) reads:
>
> %c is replaced by the locale's appropriate date and time
> representation.
>
> Use +y/+Y instead
> --
> PostgreSQL at 21. Chaos Communication Congress
>
>
> https://21c3.ccc.de/wiki/index.php/PostgreSQL
My mistake. I confused the use of cc, to set the date, with the
formatting option used by strftime(3), %c. %C is synonomous to cc. To
everyone who pointed out my error, you have my appreciation.
--
Ian P. Thomas
Destiny is not a matter of chance, it is a matter of choice. It is not a thing
to be waited for, it is a thing to be achieved.
- William Jennings Bryan