GNU bug report logs - #12162
[date] wrong time returned from provided relative date description

Previous Next

Package: coreutils;

Reported by: Andris Pavenis <andris.pavenis <at> iki.fi>

Date: Thu, 9 Aug 2012 07:47:01 UTC

Severity: normal

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andris Pavenis <andris.pavenis <at> iki.fi>
To: 12162 <at> debbugs.gnu.org
Subject: bug#12162: [date] wrong time returned from provided relative date description
Date: Thu, 09 Aug 2012 10:25:14 +0300
Noticed problems with command date:

[apavenis <at> callisto Test]$ ./date-test.sh
+ date
Thu Aug  9 10:16:31 EEST 2012
+ date -d '2 weeks ago'
Thu Jul 26 10:16:31 EEST 2012
+ date -d 'thursday 2 weeks ago'
Thu Jul 26 00:00:00 EEST 2012
+ date -d 'next month'
Sun Sep  9 10:16:31 EEST 2012
+ date -d '1 monday next month'
Thu Sep 13 00:00:00 EEST 2012
+ date -d '2 monday next month'
Thu Sep 20 00:00:00 EEST 2012

As one can see:

1) specifying both week day (eg. thursday) and week the actual
date is taken from week next to specified week. It should perhaps
be inside the specified week. The same happens if one uses
'this week', 'next week' etc.

2) specifying month and for example first monday generates
date not from the begin of the month but uses the day in current
month  as reference

Andris





This bug report was last modified 12 years and 255 days ago.

Previous Next


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