bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date bug report: %G gives incorrect year


From: Andreas Schwab
Subject: Re: date bug report: %G gives incorrect year
Date: Wed, 02 Jan 2008 15:36:44 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux)

"matt smiglarski" <address@hidden> writes:

> The following shows how the year is not rolled back.
>
> # date
> Wed Jan  2 12:12:23 GMT 2008
> # date --date '2 days ago' +'%G-%m-%d %k:%M:%S'
> 2008-12-31 12:12:53

RTFM.

`%G'
     year corresponding to the ISO week number.  This has the same
     format and value as `%Y', except that if the ISO week number (see
     `%V') belongs to the previous or next year, that year is used
     instead.  It is normally useful only if `%V' is also used; for
     example, the format `%G-%m-%d' is probably a mistake, since it
     combines the ISO week number year with the conventional month and
     day.  This is a GNU extension.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]