[Bug 51106] Re: Calculations by "date" are wrong

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Sun Jun 10 23:04:52 UTC 2012


Another obscure observation I made on Ubuntu 12.04 (probably affects all
previous versions as well):

glaubitz at ubuntu:~$ date -d "11:40 + 1 minutes"
Mon Jun 11 12:41:00 CEST 2012
glaubitz at ubuntu:~$ date -d "11:40 + 2 minutes"
Mon Jun 11 11:41:00 CEST 2012
glaubitz at ubuntu:~$ date -d "11:40 + 3 minutes"
Mon Jun 11 10:41:00 CEST 2012
glaubitz at ubuntu:~$ date -d "11:40 + 4 minutes"
Mon Jun 11 09:41:00 CEST 2012
glaubitz at ubuntu:~$ date -d "11:40 + 5 minutes"
Mon Jun 11 08:41:00 CEST 2012

On a side note, date seems to have trouble on systems where time_t is
too small (i.e. 32 bits instead of 64 bits):

glaubitz at debian32:~> lsb_release -rsc
6.0.5
squeeze
glaubitz at debian32:~> uname -a
Linux debian32 3.2.0-0.bpo.2-686-pae #1 SMP Wed May 30 01:20:28 UTC 2012 i686 GNU/Linux
glaubitz at debian32:~> date -d "1000 months ago"
date: invalid date `1000 months ago'
glaubitz at debian32:~> date -d "2000 months ago"
Tue Nov 17 06:29:07 CET 1981
glaubitz at debian32:~> logout
Connection to debian32 closed.
glaubitz at debian64:~> lsb_release -rsc
6.0.5
squeeze
glaubitz at debian64:~> uname -a
Linux debian64 3.2.0-0.bpo.1-amd64 #1 SMP Wed Jan 25 00:15:47 UTC 2012 x86_64 GNU/Linux
glaubitz at debian64:~> date -d "1000 months ago"
Mon Feb 11 01:01:14 CET 1929
glaubitz at debian64:~> date -d "2000 months ago"
Sat Oct 11 01:01:17 LMT 1845

This was tested on Debian Squeeze, but affects Ubuntu as well (tested on
Precise, 12.04). I guess this should be reported to upstream and go into
a separate bug report.

Adrian

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/51106

Title:
  Calculations by "date" are wrong

Status in The Gnu Core Utilities:
  New
Status in “coreutils” package in Ubuntu:
  Triaged

Bug description:
  Binary package hint: coreutils

  On Ubuntu 6.06 LTS, calculations by the program "date" are wrong:

  $ date --version
  date (GNU coreutils) 5.93
  (...)

  $ date -d '11:40'
  Tue Jun 27 11:40:00 CEST 2006
  $ date -d '11:40 + 8 minutes'
  Tue Jun 27 13:33:00 CEST 2006
  $ date -d '11:40 + 8 hours'
  Tue Jun 27 14:32:00 CEST 2006

  These calculations were correct in my previous Ubuntu installation.

To manage notifications about this bug go to:
https://bugs.launchpad.net/coreutils/+bug/51106/+subscriptions




More information about the foundations-bugs mailing list