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: Mon, 22 Mar 2021 22:10:20 +0300 Message-ID: References: <87v99lr26w.fsf@zoho.eu> <8735woph4e.fsf@zoho.eu> <87h7l4nnqs.fsf@zoho.eu> <87pmzrkpoa.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="8325"; 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 20:13:50 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 1lOPzq-00024V-4l for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 20:13:50 +0100 Original-Received: from localhost ([::1]:34820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOPzo-0002wy-RR for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 22 Mar 2021 15:13:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOPyp-0002ky-Fk for help-gnu-emacs@gnu.org; Mon, 22 Mar 2021 15:12:47 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:46069) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOPyl-00021A-NB for help-gnu-emacs@gnu.org; Mon, 22 Mar 2021 15:12:46 -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 000000000001E079.000000006058EC29.00007F20; Mon, 22 Mar 2021 12:12:40 -0700 Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87pmzrkpoa.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:128504 Archived-At: * Emanuel Berg via Users list for the GNU Emacs text editor [2021-03-22 21:30]: > Jean Louis wrote: > > > Maybe you should first define what is meant with > > `days-from-date'. [...] > > OK, well, hit me then, what should the definition be? > > This is for practical use, how many days till my date with > Sandra Bullock - because maybe some things need to be > arranged? ... No? Okay, bad example Is good example, would we be 30 years back in time. (This way the warriors will not easily get a clue.) > But it is also data for the sake of date because it is > interesting at least to a "datadyrkare" like me > (untranslatable Swedish pun), e.g. I did > "Artificial Intelligence" at Uppsala University 2012-05-30, > that was 8y 9m 20d ago. For that I use `age' that again uses PostgreSQL: (defun age (date) "Returns the age by using PostgreSQL. It is usable to find out the age of people" (let* ((command (format "psql -Stc \"SELECT age(date('%s'));\"" date)) (age (shell-command-to-string command)) (age (string-trim age)) (age (replace-regexp-in-string " mon " " month " age)) (age (replace-regexp-in-string " mons " " months " age))) age)) (age "2012-05-30") → 8 years 9 months 23 days I do trust the PostgreSQL and that would mean you have lost somewhere those 3 days, who knows, maybe with Sandra in sauna. > Now I used 'time-from' (zsh, not Elisp) BTW [1] Maybe there is some bug in their function. > 31! ??? Glitch in the Matrix? I would not know any more, I have given you truthful evaluation on my side. I was thinking maybe at specific time of the day it would show one day more or less, and that it was that what is happening. Because your function is not well understood on my side, I am simply skipping it and relying on PostgreSQL calls. > [1] https://dataswamp.org/~incal/conf/.zsh/time > "Artificial Intelligence" at Uppsala University 2012-05-30, $ datediff -f '%Yy %mm %dd %Hh %Mmin %Ss' 2012-05-30 2021-03-22 yields 8y 9m 20d 0h 0min 0s and I understand that, but you lost somewhere 3 days. Maybe you are discovering now bug in dateutils, or bug in PostgreSQL -- I just don't believe the latter. Leap years were 2020, 2016, maybe some days are missing because of that. Jean