help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: even elder races get tired of waiting


From: Emanuel Berg
Subject: Re: even elder races get tired of waiting
Date: Mon, 22 Mar 2021 22:33:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis wrote:

>> I get:
>> 
>> Lisp:
>> 
>> (time-from 1964 07 26 0 0 0 2021 03 22 0 0 0) ; 56y 253d 0h 0m 0s
>> 
>> zsh/dateutils.ddiff:
>> 
>> $ time-from 1964-07-26
>> 56y 7m 24d 0h 0min 0s
>> 
>> (Oh, no, now I see, not even normalized output format...)
>
> (age "1964-07-26") → 56 years 7 months 27 days
>
> Now we can see that not only you miss 3 days, she misses
> three days as well, maybe it was the sauna.
>
> Jean
>
> P.S. Who is right, PostgreSQL or diffutils?

Let's see ... don't we have any software to answer
that question? :)

The Lisp [1] cannot be easily normalized because `format-seconds'
do years and seconds but not months:

  Use format control STRING to format the number SECONDS.
  The valid format specifiers are:
  %y is the number of (365-day) years.
  %d is the number of days.
  %h is the number of hours.
  %m is the number of minutes.
  %s is the number of seconds.
  %z is a non-printing control flag (see below).
  %% is a literal "%".

Do it all into days only? Then I can use my other Lisp [same
file]

  (days-from-date "1964-07-26" "2021-03-22") ; 20693

And the zsh [2]

  $ time-from 1964-07-26
  56y 7m 24d 0h 0min 0s (20693 days)

and... *drumroll*

  (= 20693 20693) ; t

Oh no Jean, this doesn't look good for you :)

[1] https://dataswamp.org/~incal/emacs-init/time-cmp.el
[2] https://dataswamp.org/~incal/conf/.zsh/time

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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