GNU bug report logs - #8357
Improve yesterday and tomorrow calculations for common cases

Previous Next

Package: coreutils;

Reported by: Heikki Orsila <shd <at> modeemi.fi>

Date: Sun, 27 Mar 2011 21:55:02 UTC

Severity: wishlist

Tags: notabug

Full log


View this message in rfc822 format

From: Bob Proulx <bob <at> proulx.com>
To: Heikki Orsila <shd <at> modeemi.fi>
Cc: 8357 <at> debbugs.gnu.org
Subject: bug#8357: coreutils bug in date
Date: Tue, 29 Mar 2011 14:38:08 -0600
Heikki Orsila wrote:
> Bob Proulx wrote:
> > So 'yesterday' or '24 hours ago' are equivalent.  These are exactly 24
> > hours ago or 86400 seconds.  This is a critical point in your problem.
> 
> I see the problem, but IMO, the definition of yesterday should be changed
> or there should be a new definition.
> 
> What about defining new units: 'calday', 'calyesterday', 'caltomorrow'? 
> For example, $(date -d '1 calday ago' '+%F')? These would count actual 
> calendar days rather than relative time (in units of 24 hours)?

Something like that could be done.  I think there would be support for
that direction of development.

That is the problem when people put in features such as the relative
date calculations.  A simple but only partially implemented feature
sounds great but later causes an endless stream of problems.  They add
a partially nice feature but it isn't 100% perfect and then ten years
go by and people start to use it and then find the rough spots.  But
by then it is now a very long standing behavior and can't be changed.
Your suggestion to use different names avoids breaking the previous
behavior.  But still someone would need to actually do the work and
the code is not simple.  Working with human produced calender dates
has many traps and pitfalls.

Bob




This bug report was last modified 13 years and 325 days ago.

Previous Next


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