bug-coreutils
[Top][All Lists]
Advanced

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

Re: Linux Date Command gives wrong year with +%g


From: Eric Blake
Subject: Re: Linux Date Command gives wrong year with +%g
Date: Fri, 01 Jan 2010 08:28:35 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 1/1/2010 8:12 AM:
> According to Gary Warner on 1/1/2010 8:09 AM:
>> NOWDATE=`date +%g%b%d`
> 
> Not a bug.
> http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-command-is-not-working-right_002e

As a follow up, remember that today (and even as late as Jan 3, 2010) is
still part of ISO year 2009 week 53 (ISO years only change on Monday).
The effects of %g around the few days surrounding the calendar year
transition always seem to elicit spurious bug reports.  Rather than the
ISO year of %g, you want the calendar year of %y:

> %g = last two digits of year of ISO week number
  %y   last two digits of year (00..99)
  %Y   year

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAks+FKMACgkQ84KuGfSFAYAPPQCgjCFU10FQ2Mvut6GbSJOEkyE1
PbkAniE2WBWcSplD14Q5muxGn8uksrfH
=LLVK
-----END PGP SIGNATURE-----




reply via email to

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