unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: emacs-devel@gnu.org
Subject: Re: format-time-string bug
Date: Tue, 13 Apr 2004 10:49:43 +0900 (JST)	[thread overview]
Message-ID: <200404130149.KAA11662@etlken.m17n.org> (raw)
In-Reply-To: <87zn9g3an9.fsf@kali.intranet> (message from Marcelo Toledo on Mon, 12 Apr 2004 21:54:34 -0400)

In article <87zn9g3an9.fsf@kali.intranet>, Marcelo Toledo <marcelo@marcelotoledo.org> writes:

> A few days ago I was coding something related to time, then I needed to
> use the function `format-time-string´ 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

  reply	other threads:[~2004-04-13  1:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-13  1:54 format-time-string bug Marcelo Toledo
2004-04-13  1:49 ` Kenichi Handa [this message]
2004-04-13  2:54 ` Danilo Segan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200404130149.KAA11662@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).