[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: date in core utils
From: |
Rene de Zwart |
Subject: |
Re: date in core utils |
Date: |
Thu, 31 Mar 2005 10:32:42 +0200 |
User-agent: |
Mutt/1.5.8i |
On Wed, Mar 30, 2005 at 11:43:24PM -0500, Paul Eggert wrote:
> Rene de Zwart <address@hidden> writes:
>
> > I debbuged date from coreutils 5.3.0 and got
> > get_date (&when, datestr, NULL);
> > with datestr="19370701"
> > returned invalid date
> >
> > So it is at a different level than date.
>
> But get_date is shipped as part of coreutils 5.3.0, so if it is
> a bug in get_date then it is a bug in coreutils 5.3.0.
>
> Can you investigate why get_date is failing on your host?
> (It doesn't fail on mine.)
Well I did and and I came out to the lines lib/getdate.c
1302
tm0 = tm;
Start = mktime (&tm);
if (! mktime_ok (&tm0, &tm, Start))
/* mktime changes tm and causes mktime_ok to fail because
tm.tm_sec
tm.tm_min
tm.tm_hour
are changed but that only happens for 19370701
other dates work ok. The problem seems to be in mktime
*/
I can get it to work by doing
TZ=GMT0 date --date="19370701" +"%Y%m%d"
but what fails to me is that I did this for
date --date="19011216" +"%Y%m%d %u %V"
date --date="19011217" +"%Y%m%d %u %V"
...
...
...
date --date="20040226" +"%Y%m%d %u %V"
date --date="20040227" +"%Y%m%d %u %V"
date --date="20040228" +"%Y%m%d %u %V"
date --date="20040229" +"%Y%m%d %u %V"
Out of 37331 dates only --date="19370701" +"%Y%m%d %u %V"
gave this weird answer 9370630 3 26
I don't know what to think of it.
I'll ask on a gentoo forum if they see the same thing.
Thanks for your time