Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
tag 23270 notabug
close 23270
thanks
Hello Maarten Mastbroek,
On 04/11/2016 12:36 PM, Maarten wrote:
I recently discovered a bug, or at least unexpected behavior, about
the ‘date’ command which I want to report. The bug is related to the
moment of ‘daylight saving time’ (summertime / wintertime)
[...] When I request a ‘yesterday' request is about 24 hours before.
In GNU 'date', the relative period of 'yesterday' is defined exactly as 24
hours,
regardless of daylight saving time.
The recommended way to perform all relative day calculations is to specify
12:00pm,
so that adding/subtracting 24-hours avoids DST issues.
Example:
date -d "12:00 yesterday" +%d-%m-%Y
(similarly, when calculating relatives months, it is recommended to specify the
15th of the month, to avoid leap-years issues.)
As such I'm closing this bug, but discussion can continue by replying to this
thread.
regards,
- assaf