From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: even elder races get tired of waiting Date: Mon, 22 Mar 2021 22:33:10 +0100 Message-ID: <87y2ee6fhl.fsf@zoho.eu> References: <87v99lr26w.fsf@zoho.eu> <8735woph4e.fsf@zoho.eu> <87h7l4nnqs.fsf@zoho.eu> <87pmzrkpoa.fsf@zoho.eu> <87wntzj7h8.fsf@zoho.eu> Reply-To: Emanuel Berg Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="999"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:0CRIdJVlvWpSN0y5P4OoOpUWx6g= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 22 22:34:24 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lOSBr-00005k-Kh for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 22:34:23 +0100 Original-Received: from localhost ([::1]:40980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOSBq-0003H1-Mz for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 17:34:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOSAx-0003Eb-R0 for help-gnu-emacs@gnu.org; Mon, 22 Mar 2021 17:33:27 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:44640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOSAs-0004o2-3I for help-gnu-emacs@gnu.org; Mon, 22 Mar 2021 17:33:24 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1lOSAn-0009IO-2a for help-gnu-emacs@gnu.org; Mon, 22 Mar 2021 22:33:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128510 Archived-At: 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