From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: format-time-string bug Date: Tue, 13 Apr 2004 10:49:43 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200404130149.KAA11662@etlken.m17n.org> References: <87zn9g3an9.fsf@kali.intranet> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1081822954 24255 80.91.224.253 (13 Apr 2004 02:22:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Apr 2004 02:22:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Apr 13 04:22:29 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BDDZF-0006Pw-00 for ; Tue, 13 Apr 2004 04:22:29 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BDDZD-0000m7-00 for ; Tue, 13 Apr 2004 04:22:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BDDHQ-0002TD-A8 for emacs-devel@quimby.gnus.org; Mon, 12 Apr 2004 22:04:04 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BDD4D-0000Sq-Vf for emacs-devel@gnu.org; Mon, 12 Apr 2004 21:50:25 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BDD3g-0000O3-9Y for emacs-devel@gnu.org; Mon, 12 Apr 2004 21:50:23 -0400 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BDD3d-0000NF-EK for emacs-devel@gnu.org; Mon, 12 Apr 2004 21:49:49 -0400 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2]) by tsukuba.m17n.org (8.11.6p2/8.11.6) with ESMTP id i3D1ni820022; Tue, 13 Apr 2004 10:49:44 +0900 (JST) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) by fs.m17n.org (8.11.6p2/8.11.6) with ESMTP id i3D1nh916517; Tue, 13 Apr 2004 10:49:43 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id KAA11662; Tue, 13 Apr 2004 10:49:43 +0900 (JST) Original-To: marcelo@marcelotoledo.org In-reply-to: <87zn9g3an9.fsf@kali.intranet> (message from Marcelo Toledo on Mon, 12 Apr 2004 21:54:34 -0400) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21550 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21550 In article <87zn9g3an9.fsf@kali.intranet>, Marcelo Toledo writes: > A few days ago I was coding something related to time, then I needed to > use the function `format-time-string=B4 and the code above shows what I > have found wrong: > (setq t1 (current-time)) > (sleep-for 3) > (setq t2 (current-time)) > (format-time-string "(%H:%M:%S)" (time-subtract t2 t1)) > the result of the last expression should be something near 00:00:03. > For me it is appearing 20:00:03. For other people it's appearing > diferent values but never what I am really expecting. Could someone > please try? 20:00:03 is the correct value for you because it seems that your timezone is -0400. As I'm in JST, I get "09:00:03". If you want "00:00:03", you must call format-time-string as below. > (format-time-string "(%H:%M:%S)" (time-subtract t2 t1) t) By the way, format-time-string is for time, not for a period. --- Ken'ichi HANDA handa@m17n.org