bug-gnu-utils
[Top][All Lists]
Advanced

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

Oddity or bug in GNU date installation?


From: Georg Bauhaus
Subject: Oddity or bug in GNU date installation?
Date: Tue, 04 May 2010 15:46:36 -0000
User-agent: Thunderbird 2.0.0.24 (Macintosh/20100228)

I'm running into a problem when calculating offsets (days)
with GNU date (on a SuSE machine). It looks like a bug to me.
(Or is it a summer time issue?  Or am I being dense?)


The following two dates and times are reported correctly WRT
the wall clock.
They say when the commands further below were issued.

$ date -u
Tue Mar 30 08:12:58 UTC 2010
$ date
Tue Mar 30 10:19:20 CEST 2010

# Now 29 - 3 equals 25 ...

$ date '--date=2010-03-29 - 3 day' +%Y%m%d
20100325
$ date '--date=2010-03-29 - 2 day' +%Y%m%d
20100326
$ date '--date=2010-03-29 - 1 day' +%Y%m%d
20100327
$ date '--date=2010-03-29 - 0 day' +%Y%m%d
20100329


The offsets are different (correct) when --date is before
2010-03-29.
But again,

$ date '--date=2010-03-30 - 3 day' +%Y%m%d
20100326
$ date '--date=2010-03-31 - 3 day' +%Y%m%d
20100327
$ date '--date=2010-04-01 - 3 day' +%Y%m%d
20100329

(In order to compare I ran the same comands using gdate 6.10
port-ed to Mac OS X.  It behaves as I would have expected,
i.e. unlike the above.)


$ date --version
date (GNU coreutils) 5.93
Copyright (C) 2005 Free Software Foundation, Inc.

$ cat /etc/lsb-release
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-ia32:core-3.0-ia32"

$ cat /etc/SuSE-release
SUSE Linux Enterprise Server 10 (i586)
VERSION = 10
PATCHLEVEL = 2

Is this a bug in GNU date 5.93?


TIA,
-- Georg Bauhaus


reply via email to

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