bug-coreutils
[Top][All Lists]
Advanced

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

Re: date problem


From: Eric Blake
Subject: Re: date problem
Date: Mon, 30 Mar 2009 07:31:01 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[adding the list anyway]

According to Heiko Schlichting on 3/30/2009 7:09 AM:
> Eric,
> 
> thank you for your quick response. I dont't send this answer to the list as
> this is a frequent question and bothering people is not my intention.
> 
> But the question is frequent as this a really unexpected behavior. You can
> document it and improve the FAQ (which does not really describe this case
> even after reading FAQ 24 multiple times) but as it is so unexpected,
> I doubt that this question will cease.

If our FAQ doesn't answer the frequent question, then we should improve
it.  Hence, involving the list is the right thing, when you are arguing
that the FAQ is insufficient.

> 
>> If you have a suggestion on how to improve the FAQ, we are all ears.
> 
> My english is to weak but I would like the cases 'yesterday', '3 days ago',
> and 'last month' documented. It should also be documented how this can be
> avoided if the format contains only %d, %m, %Y and so on (which I expected
> as the usual case):
> 
>     -d '12:00 yesterday'
>     -d '12:00 3 days ago'
> 
> I don't know about a similar single-call workaround for 'last month' as it
> is not possible to specify '15th of the actual month' without calling date
> to get the actual month first.
> 
> My suggestions:
> 
> I understand that it is really hard to change the behavior of date but
> implementing it with an additional keyword should be possible. Something
> like
> 
>     -d 'real yesterday'
>       (-> same time on the previous day, if this time does exists twice
>       as during daylight saving end, use the later. If this time does not
>       exists as during daylight saving start use moment after daylight
>       saving is in effect)
> 
>     -d 'real 1 month ago'
>         (-> if this day does not exists (e.g. 30th feb) use the last day of
>       the month)
> 
> 'real' is hard to implement. An easier or additional solution could be
> 
>     -d 'mid yesterday'
>        (-> same a '12:00 yesterday')
> 
>     -d 'mid 1 month ago'
>        (15th of actual month subtracted 30 days)
> 
> and so on for other relative specifications. Ok, not perfect but these are
> only suggestions as I doubt that documenting the actual behaviour is not
> enough.

Thanks for the suggestions on improving the date parser.  By involving the
list, maybe someone with enough interest can write a patch along those lines.

> 
> Thanks for your fast response again, Heiko.

Not a problem.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknQyZUACgkQ84KuGfSFAYAkFQCgzBcOBnPkgbHR35rL8I7TD+yC
WaQAn3Z2DOLYIQJ/JWfVBsOGIU50FRan
=x2sy
-----END PGP SIGNATURE-----




reply via email to

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