bug-coreutils
[Top][All Lists]
Advanced

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

bug#26101: Counterproductive calculation order in date


From: Ulf Zibis
Subject: bug#26101: Counterproductive calculation order in date
Date: Wed, 15 Mar 2017 23:37:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0


Am 15.03.2017 um 15:40 schrieb Assaf Gordon:
To give more details about the inter working of date adjustments:
Much thanks for outlining these details in great clarity.

You'd like to be able to do date calculations in some predictable way,
Yes!
Currently the result is not predictable because the order of processing the terms is not defined transparently.

in your case to be able to change a file's timestamp.

Not any more as thanks to Eric I now know how to do that by only help of touch.

However,
consider that adjusting by any scale (years/months/days/hours/minutes) will
have side-effects.

Adjusting by months can shift days (e.g. "2016-03-30 - 1 month" is still march).
Adjusting by days can shift hours (e.g. on Day light saving time),
Adjusting by hours can stay in the same day (e.g. "+24 hours" on a when day light saving 
results in 25 "hours").
etc.

It is the edge-cases that make day adjustment tricky (e.g. "+1 month" is not "+30 days", "+1 
day" is not always "+24 hours", etc.).

If you can come up with reliable and predictable rules for date adjustment that 
will not have these unexpected results - there's definitely room for 
improvements.

I do not see any problems with adjustment when determining the processing order from left to right, but I'm not a real specialist to that subject.

However, there's also the existing behavior and backwards compatibility that 
will need to be taken into account.

This may be an important issue.
On the other hand, such side effects could also result from arbitrary code changes, as the processing order to follow is nowhere determined. Maybe an intelligent search over all shell scripts of a typical Linux installation could discover the usage of such cases.

-Ulf


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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