GNU bug report logs - #18328
date: '8pm -0500' is invalid (am/pm problem)

Previous Next

Package: coreutils;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Mon, 25 Aug 2014 16:02:01 UTC

Severity: normal

Tags: confirmed

To reply to this bug, email your comments to 18328 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#18328; Package coreutils. (Mon, 25 Aug 2014 16:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 25 Aug 2014 16:02:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-coreutils <at> gnu.org
Subject: can't say date -d '8pm -0500' though other combos work
Date: Tue, 26 Aug 2014 00:01:16 +0800
$ date -d '8pm -0500'
date: invalid date ‘8pm -0500’ <--why can't this combo work?
$ date -d '20:00 -0500'
二  8月 26 09:00:00 CST 2014
$ date -d 'sun 8pm'
日  8月 31 20:00:00 CST 2014
$ date -d '8pm'
一  8月 25 20:00:00 CST 2014




Information forwarded to bug-coreutils <at> gnu.org:
bug#18328; Package coreutils. (Sat, 20 Oct 2018 04:26:02 GMT) Full text and rfc822 format available.

Message #8 received at 18328 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>,
 18328 <at> debbugs.gnu.org
Subject: Re: bug#18328: can't say date -d '8pm -0500' though other combos work
Date: Fri, 19 Oct 2018 22:25:00 -0600
tags 18328 confirmed
retitle 18328 date: '8pm -0500' is invalid (am/pm problem)
stop

(triaging old bugs)

Hello,

On 25/08/14 10:01 AM, 積丹尼 Dan Jacobson wrote:
> $ date -d '8pm -0500'
> date: invalid date ‘8pm -0500’ <--why can't this combo work?

This is indeed a bug (specifically in gnulib's date parsing module,
but easier to track here).

It seems the existence of the "am/pm" string causes the parser
to take a slightly different rule, then reject additional relative
values, unless they have a unit, e.g.:

  $ date --debug -d '8pm +5 days'
  date: parsed time part: 08:00:00pm
  date: parsed relative part: +5 day(s)
  [...]

Contrast it with a different (and confusing) rules when there is
no "am/pm", the relative number is always taken as the time zone, e.g.:

  $ date --debug -d '8:00 +5 days'
  date: parsed time part: 08:00:00 UTC+05
  date: parsed relative part: +1 day(s)
  date: input timezone: parsed date/time string (+05)
  [...]

(from https://bugs.gnu.org/17161#31 )

I hope to get to this bug soon.

-assaf




Added tag(s) confirmed. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 20 Oct 2018 04:26:02 GMT) Full text and rfc822 format available.

Changed bug title to 'date: '8pm -0500' is invalid (am/pm problem)' from 'can't say date -d '8pm -0500' though other combos work' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 20 Oct 2018 04:26:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#18328; Package coreutils. (Sat, 20 Oct 2018 06:31:02 GMT) Full text and rfc822 format available.

Message #15 received at 18328 <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: Assaf Gordon <assafgordon <at> gmail.com>
Cc: 18328 <at> debbugs.gnu.org
Subject: Re: bug#18328: can't say date -d '8pm -0500' though other combos work
Date: Sat, 20 Oct 2018 14:30:25 +0800
AG> I hope to get to this bug soon.

Good.




This bug report was last modified 6 years and 240 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.