On 10 Apr 2007, at 01:28, paul at clubi.ie wrote:
> On Mon, 9 Apr 2007, Niall O Broin wrote:
>>> Inspired by the fact that I had one server where I did NOT see the
>> log rotation problem, I've now tested this on a variety of systems
>> using
>>>> date --version|head -1;date -d "3 weeks ago" +%H; date +%H
>>> IMO the two numbers returned after the version string should be
>> the same.
>> Why do you think that?
Because I feel that 3 weeks ago does NOT always mean 3*7*24 hours
ago, the exception being where there has been an intervening DST
transition.
> The hour number might work out the same for 2*7*24 hours ago, but
> between then and 3*7*24 hours ago, an hour was 'squeezed' out..
> Further, you're leaving stuff out. I.e. try:
>> $ date --version|head -1;date -d "3 weeks ago" +"%H %Z" ; date "+%H
> %Z"
> date (GNU coreutils) 5.97
> 00 GMT
> 01 IST
>>> for TZ, or with TZ=CET, I see the anomalous behaviour with the
>> 5.9x versions.
>> You mean you saw the anamalous behaviour with versions /prior/ to
> 5.9x.
That's your view (and presumably the Gnu date maintainers). I wonder
is there some standards document which defines this behaviour?
The particularly hairy answer is where you request date -d "3 weeks
ago 08:00" where the date returned will vary by 24 hours, depending
on what time of the day you run date.
Bottom line of course is that if you want to do reliable date
arithmetic or manipulation you use UTC. This is something I'm well
used to from working in an industry where that was standard, but when
you're producing information for the great unwashed, they tend to
like it to be related to their timezone IME.
Niall
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!