From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: even elder races get tired of waiting Date: Tue, 23 Mar 2021 01:43:50 +0300 Message-ID: References: <8735woph4e.fsf@zoho.eu> <87h7l4nnqs.fsf@zoho.eu> <87pmzrkpoa.fsf@zoho.eu> <87wntzj7h8.fsf@zoho.eu> <87y2ee6fhl.fsf@zoho.eu> 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="22071"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.6 (2021-03-06) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 22 23:51:38 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 1lOTOc-0005cs-6J for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 23:51:38 +0100 Original-Received: from localhost ([::1]:44362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOTOb-0000pI-8f for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 18:51:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOTLs-00087j-Jt for help-gnu-emacs@gnu.org; Mon, 22 Mar 2021 18:48:48 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:41127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOTLq-0004S3-GU for help-gnu-emacs@gnu.org; Mon, 22 Mar 2021 18:48:48 -0400 Original-Received: from localhost ([::ffff:41.202.241.53]) (AUTH: PLAIN securesender, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001E1B8.0000000060591ECB.0000193F; Mon, 22 Mar 2021 15:48:43 -0700 Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87y2ee6fhl.fsf@zoho.eu> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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:128512 Archived-At: * Emanuel Berg via Users list for the GNU Emacs text editor [2021-03-23 00:34]: > 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 :) Hmm: $ date --utc -d 'jul 7 1964 +56years +7months +24days' Wed Mar 3 12:00:00 AM UTC 2021 I am not sure if you have tested it on Monday or Tuesday, today. Your function was showing yesterday Monday the difference of 56 years, 7 months and 24 days from 1964-07-26, but `date' command tells that difference comes tomorrow, Wednesday. That is discrepancy to my result from PostgreSQL and your result with datediff. We have to find solution that works, as no Sandra wants to be called older than she is. Jean