all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Edward O'Connor" <hober0@gmail.com>
To: emacs-devel@gnu.org
Cc: www-archive@w3.org
Subject: Format modifier suggestion for format-time-string
Date: Fri, 19 Nov 2010 11:23:09 -0800	[thread overview]
Message-ID: <AANLkTimxeUJ5agMxEBYT4+1oEN=jYgUwpUoUfmvt9-qU@mail.gmail.com> (raw)

Hi.

When generating data formats that rely on RFC 3339 date and time formats
(Atom, say) in elisp, I've often found myself having to do something
like this:

(defun rfc3339-datetime (&optional time)
  (let ((stamp (format-time-string "%Y-%m-%dT%H:%M:%S%z" time)))
    (format "%s:%s" (substring stamp 0 -2) (substring stamp -2))))

In RFC 3339, the colon separating hours and minutes within a time zone
offset is mandatory, but `format-time-string' doesn't have the ability
to generate time zone offsets with a colon in them.

I'd like to suggest the addition of a : modifier, such that
(format-time-string "%:z") would generate an RFC 3339-compatible time
zone offset.

What do you think?


Thanks for the consideration,
Ted



             reply	other threads:[~2010-11-19 19:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-19 19:23 Edward O'Connor [this message]
2010-11-19 19:30 ` Format modifier suggestion for format-time-string Lars Magne Ingebrigtsen
2010-11-19 19:36   ` Edward O'Connor
  -- strict thread matches above, loose matches on Subject: below --
2010-11-21  4:48 MON KEY
2010-11-21 17:47 ` Eli Zaretskii
2010-11-21 20:18   ` MON KEY

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

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

  git send-email \
    --in-reply-to='AANLkTimxeUJ5agMxEBYT4+1oEN=jYgUwpUoUfmvt9-qU@mail.gmail.com' \
    --to=hober0@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=www-archive@w3.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.