Debian Bug report logs - #562485
/bin/date: "a fortnight ago" is an hour off

version graph

Package: coreutils; Maintainer for coreutils is Michael Stone <mstone@debian.org>; Source for coreutils is src:coreutils.

Reported by: "brian m. carlson" <sandals@crustytoothpaste.net>

Date: Thu, 24 Dec 2009 17:51:01 UTC

Severity: normal

Found in versions coreutils/8.5-1, coreutils/8.0-2

Reply or subscribe to this bug.

Toggle useless messages

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


Report forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#562485; Package coreutils. (Thu, 24 Dec 2009 17:51:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "brian m. carlson" <sandals@crustytoothpaste.ath.cx>:
New Bug report received and forwarded. Copy sent to Michael Stone <mstone@debian.org>. (Thu, 24 Dec 2009 17:51:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "brian m. carlson" <sandals@crustytoothpaste.ath.cx>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: /bin/date: "a fortnight ago" is an hour off
Date: Thu, 24 Dec 2009 17:47:17 +0000
[Message part 1 (text/plain, inline)]
Package: coreutils
Version: 8.0-2
Severity: normal
File: /bin/date

lakeview ok % date; date -d"a fortnight ago"; date -d"14 days ago" 
Thu Dec 24 17:37:15 UTC 2009
Thu Dec 10 18:37:15 UTC 2009
Thu Dec 10 17:37:15 UTC 2009
lakeview ok % (export LC_ALL=C; date; date -d"a fortnight ago"; date -d"14 days ago")
Thu Dec 24 17:39:29 UTC 2009
Thu Dec 10 18:39:29 UTC 2009
Thu Dec 10 17:39:29 UTC 2009

Obviously, "a fortnight ago" should be exactly equivalent to "14 days
ago", but it's not.  Daylight Saving Time is not relevant here because
(a) this is UTC, (b) DST in the US ended in November, and (c) LC_ALL=C
shows the same behavior.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages coreutils depends on:
ii  libacl1                       2.2.49-1   Access control list shared library
ii  libattr1                      1:2.4.44-1 Extended attribute shared library
ii  libc6                         2.10.2-2   GNU C Library: Shared libraries
ii  libselinux1                   2.0.89-4   SELinux runtime shared libraries

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only
OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#562485; Package coreutils. (Sat, 29 May 2010 23:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brian Marshall <bmars@sdf.lonestar.org>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Sat, 29 May 2010 23:33:03 GMT) Full text and rfc822 format available.

Message #10 received at 562485@bugs.debian.org (full text, mbox):

From: Brian Marshall <bmars@sdf.lonestar.org>
To: 562485@bugs.debian.org
Subject: Re: /bin/date: "a fortnight ago" is an hour off
Date: Sat, 29 May 2010 16:23:32 -0700
[Message part 1 (text/plain, inline)]
On Thu, Dec 24, 2009 at 05:47:17PM +0000, brian m. carlson wrote:
> lakeview ok % date; date -d"a fortnight ago"; date -d"14 days ago" 
> Thu Dec 24 17:37:15 UTC 2009
> Thu Dec 10 18:37:15 UTC 2009
> Thu Dec 10 17:37:15 UTC 2009
> lakeview ok % (export LC_ALL=C; date; date -d"a fortnight ago"; date -d"14 days ago")
> Thu Dec 24 17:39:29 UTC 2009
> Thu Dec 10 18:39:29 UTC 2009
> Thu Dec 10 17:39:29 UTC 2009
> 
> Obviously, "a fortnight ago" should be exactly equivalent to "14 days
> ago", but it's not.  Daylight Saving Time is not relevant here because
> (a) this is UTC, (b) DST in the US ended in November, and (c) LC_ALL=C
> shows the same behavior.

In UTC-0700, it's 6 hours behind.

brian@neon:~$ date; date -d"a fortnight ago"; date -d"14 days ago"
Sat May 29 15:55:48 PDT 2010
Sat May 15 09:55:48 PDT 2010
Sat May 15 15:55:48 PDT 2010
brian@neon:~$ (export LC_ALL=C; date; date -d"a fortnight ago"; date -d"14 days ago)
Sat May 29 15:56:02 PDT 2010
Sat May 15 09:56:02 PDT 2010
Sat May 15 15:56:02 PDT 2010

I guess "a fortnight ago" is doing something weird with the UTC-0100
timezone.

Two servers running lenny (one with the same UTC-0700 timezone, another
with UTC+0000) don't have this bug.

Brian
[signature.asc (application/pgp-signature, inline)]

Changed Bug submitter to '"brian m. carlson" <sandals@crustytoothpaste.net>' from '"brian m. carlson" <sandals@crustytoothpaste.ath.cx>' Request was from "brian m. carlson" <sandals@crustytoothpaste.net> to control@bugs.debian.org. (Thu, 03 Feb 2011 20:51:58 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Michael Stone <mstone@debian.org>:
Bug#562485; Package coreutils. (Sun, 27 Feb 2011 17:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "brian m. carlson" <sandals@crustytoothpaste.net>:
Extra info received and forwarded to list. Copy sent to Michael Stone <mstone@debian.org>. (Sun, 27 Feb 2011 17:33:03 GMT) Full text and rfc822 format available.

Message #17 received at 562485@bugs.debian.org (full text, mbox):

From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: 562485@bugs.debian.org, control@bugs.debian.org
Subject: More information on date bug
Date: Sun, 27 Feb 2011 17:31:11 +0000
[Message part 1 (text/plain, inline)]
found 562485 coreutils/8.5-1
kthxbye

Okay, I've found some interesting things that seem to demonstrate the
problem better.

  lakeview ok % date; date -d"a fortnight ago"; date -d"b fortnight ago"; date -d"1 fortnight ago"; date -d"1 fortnight ago a"; date -d"14 days ago"
  Sun Feb 27 17:28:09 UTC 2011
  Sun Feb 13 18:28:09 UTC 2011
  Sun Feb 13 19:28:09 UTC 2011
  Sun Feb 13 17:28:09 UTC 2011
  Sun Feb 13 18:28:09 UTC 2011
  Sun Feb 13 17:28:09 UTC 2011

The issue here is that date is treating "a" and "b" as US military time
zone specifiers. A is UTC+01:00 and B is UTC+02:00.  This happens to
clash with the use of the article "a" in English.  I think the
reasonable thing to do here is to treat "a" as an article (that is, ==
1) if it proceeds a noun and a time zone specifier otherwise.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
[signature.asc (application/pgp-signature, inline)]

Bug Marked as found in versions coreutils/8.5-1. Request was from "brian m. carlson" <sandals@crustytoothpaste.net> to control@bugs.debian.org. (Sun, 27 Feb 2011 17:33:10 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 00:02:05 2014; Machine Name: beach.debian.org

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