On 15/03/18 00:15, Assaf Gordon wrote: > Hello, > > On Wed, Mar 14, 2018 at 05:22:04PM -0700, Paul Eggert wrote: >> On 03/13/2018 06:42 PM, Assaf Gordon wrote: >>> Therefore it is always recommended to use noon (12pm) >>> as explicit time when adjusting days >> >> Maybe "date" should default to 12:00 instead of to 00:00 when the time is >> not specified? That would avoid this sort of problem, typically. > > Technically it's an easy fix (patch attached), > but it changes a long-standing behavior. > > I wonder if it will break some existing scripts that might rely > on being 'midnight'? (even implicitly, because the user isn't aware of > this nuance). > > For example, currently '2018-03-15 + 14 hours' is 2pm on March 15th. > With this change, it'll result in 2am on March 16th. > > What do you think?
Yes picking 12:00 always is too simplistic I think. The base should be dependent on the relative unit. I proposed a solution previously at: http://bugs.gnu.org/18159#8 See also https://bugs.gnu.org/11101 cheers, Pádraig