From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: 50 seconds is 1 hour? Date: Tue, 1 Dec 2009 09:24:41 -0800 (PST) Message-ID: <48322.130.55.118.19.1259688281.squirrel@webmail.lanl.gov> References: Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1259688324 1477 80.91.229.12 (1 Dec 2009 17:25:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Dec 2009 17:25:24 +0000 (UTC) Cc: Andreas Schwab , Emacs-Devel devel To: "Lennart Borgman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 01 18:25:17 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NFWTP-00010G-8n for ged-emacs-devel@m.gmane.org; Tue, 01 Dec 2009 18:25:11 +0100 Original-Received: from localhost ([127.0.0.1]:40847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFWTO-0005wD-OO for ged-emacs-devel@m.gmane.org; Tue, 01 Dec 2009 12:25:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFWTD-0005tn-L6 for emacs-devel@gnu.org; Tue, 01 Dec 2009 12:24:59 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFWT8-0005sk-Po for emacs-devel@gnu.org; Tue, 01 Dec 2009 12:24:59 -0500 Original-Received: from [199.232.76.173] (port=33372 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFWT8-0005sa-IV for emacs-devel@gnu.org; Tue, 01 Dec 2009 12:24:54 -0500 Original-Received: from proofpoint2.lanl.gov ([204.121.3.26]:54422) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NFWT7-0001WS-MD for emacs-devel@gnu.org; Tue, 01 Dec 2009 12:24:54 -0500 Original-Received: from mailrelay2.lanl.gov (mailrelay2.lanl.gov [128.165.4.103]) by proofpoint2.lanl.gov (8.14.3/8.14.3) with ESMTP id nB1HOdYF008291; Tue, 1 Dec 2009 10:24:46 -0700 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 28C3715CD748; Tue, 1 Dec 2009 10:24:42 -0700 (MST) X-NIE-2-Virus-Scanner: amavisd-new at mailrelay2.lanl.gov Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay2.lanl.gov (Postfix) with ESMTP id 157C815CD747; Tue, 1 Dec 2009 10:24:42 -0700 (MST) Original-Received: by webmail1.lanl.gov (Postfix, from userid 48) id 1400B1DE0253; Tue, 1 Dec 2009 10:24:41 -0700 (MST) Original-Received: from 130.55.118.19 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Tue, 1 Dec 2009 09:24:41 -0800 (PST) In-Reply-To: User-Agent: SquirrelMail/1.4.8-5.7.lanl7 X-Priority: 3 (Normal) Importance: Normal X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5, 1.2.40, 4.0.166 definitions=2009-12-01_08:2009-11-30, 2009-12-01, 2009-12-01 signatures=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:118037 Archived-At: > I meant "can't we use it for this too?". Not really: it can't do anything useful for intervals longer than one day. Sure, up to 31 days you can get (n+1)dHHhMMmSSs with the format string "%dd%Hh%Mm%Ss", but obviously the n+1 is absurdly ugly (trying to fix it by subtracting 86400 gives 31 rather than 0 for small intervals). And after that it's entirely useless; a "month" is not a useful, fixed unit of time in its reckoning. The hack thus covers 0-86399 well (if you know you're in that range, so you don't print the day), and 86400-2678399 in a very silly, broken way, and it fails for the other 99.94% of time values, including all negative intervals (which may or may not make sense depending on the application, but "-3 seconds" or "3 seconds ago" is clearly much more correct than "31d23h59m57s"). And it can't indicate partial seconds. Clearly, extending it to handle all this would interfere terribly with its correct usage. So, no. Perhaps you'd like to specify an interface for the function you'd really like to have? I'd be willing to write it if I knew what exactly you wanted it to return. (For instance, should it omit fields that are 0? That is, without varying any formatting arguments that it might have, should it be able to return "5:34" and "1:00:31" for 334 and 3631 seconds?) Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.