tag 80632 notabug
close 80632
stop
On 17/03/2026 19:40, Hayek, Khalil (he, him | il, lui) wrote:
UNCLASSIFIED - NON CLASSIFIÉ
Good day,
I noticed this behaviour of the "date" command today, and perhaps it is a bug,
or it's by design.
Running date -date="-5 days 4 hours" produces the date minus 5 days from now plus 4 hours, whereas
the intent is more likely to be "-5 days and 4 hours". I tried it with other numbers of days and
hours and observed the same behaviour. Running date -date="-5 days -4 hours" produces the expected
time.
That _is_ a bit of a gotcha,
but I don't think we can change it at this stage
as existing scripts may be depending on current behavior.
closing this for now.
thank you,
Padraig