bug-coreutils
[Top][All Lists]
Advanced

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

Re: date issues with YYYYMMDD/YYMMDD date format and relative offset


From: Ondřej Vašík
Subject: Re: date issues with YYYYMMDD/YYMMDD date format and relative offset
Date: Mon, 19 Nov 2007 09:08:33 +0100

Hi Jim,

Jim Meyering wrote:
> However, there's a simple work-around: simply to drop the "+", e.g.,
> 
>   $ date -d '20050101 1 day'
>   Sun Jan  2 00:00:00 CST 2005

Yes, I know about that work-around, you could use unsigned offset/
unsigned offset ago as work-around, but the behaviour still differs
from the others for that format - and that's imho wrong.

> In any case, I couldn't accept that patch, because it would allow
> the YYYYMMDD syntax anywhere get_date currently accepts a "rel"
> (relative offset) non-terminal.

Sorry, that was my fault, but it had nothing to do with nonterminal
"rel" -I used pc->dates_seen=true; instead pc->dates_seen++; and that
allowed usage of more date inputs(made dates_seen non-terminal). Sorry
for that error, have to check my patches more carefully next time.

I improved previous patch, created hybrid section - as is more clean
to have such things out of common sections (maybe same thing from "zone"
section should be moved here - of course with pc->zones_seen++) and used
the same code as is in "number" section + relative signed offset code. 

This should solve your objection. Is the patch now acceptable?

Greetings,
         Ondrej Vasik

Attachment: coreutils-getdateYYYYMMDD.patch
Description: Text Data

Attachment: signature.asc
Description: Toto je digitálně podepsaná část zprávy


reply via email to

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