Ondřej Vašík <[EMAIL PROTECTED]> wrote:
> date command has some troubles with YYYYMMDD date format.
> When you try 'date -d "20050101 +1 day"' (or whatever
> relative offset), you will get invalid date because
> of conflicts in translation tables. Nearly same command
> date -d "20050101 UTC +1 day" is working correctly with
> current version of coreutils.
>
> Solution is easy - to add hybrid date/time/relative option
> to getdate.y as I did in attached patch. Should be
> harmless for the rest of date formats. I know that
> this YYYYMMDD format is not recommended in any man/info
> pages, but is still considered valid, so should be
> handled correctly. Same is corrected for time
> hhmm/hh format.
> (for details you can check redhat bugzilla #377781)

Hi Ondřej,

Thanks for the patch.
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

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.


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to