all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: MON KEY <monkey@sandpframing.com>
To: emacs-devel@gnu.org
Subject: Can `format-time-string' produce full/extended ISO 8601 times?
Date: Thu, 30 Jul 2009 18:10:26 -0400	[thread overview]
Message-ID: <d2afcfda0907301510m546ac399te49ddbb966e47ccb@mail.gmail.com> (raw)

Does `format-time-string' produce full/extended ISO 8601 format times?

-
Docstring of `format-time-string' states:

 "For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z"."

As best I can gather this is _not_ a 'full' ISO 8601 time string format.
Specifically, section 4.2.5.1-2 of ISO 8601:2004(E)

--
4.2.5.1 Difference between local time and UTC of day

Basic format:      ±hhmm             Example: +0100
                     ±hh                      +01

Extended format:   ±hh:mm            Example: +01:00

--
4.2.5.2 Local time and the difference from UTC

Basic format:      hhmmss±hhmm       Example: 152746+0100
                                              152746−0500
                   hhmmss±hh                  152746+01
                                              152746−05

Extended format:   hh:mm:ss±hh:mm    Example: 15:27:46+01:00
                                              15:27:46−05:00
                   hh:mm:ss±hh                15:27:46+01
                                              15:27:46−05

---
I am referencing from the .pdf available here:
(URL `http://isotc.iso.org/livelink/livelink/4021199/ISO_8601_2004_E.zip?func=doc.Fetch&nodeid=4021199')

----
Is it possible to format the UTC offset/ZONE with a colon per the
Extended format above?

On a w32 system I'm get these results:

(format-time-string "%Y-%m-%dT%T%z")
;=>"2009-07-30T18:04:56-0400"

(format-time-string "%Y-%m-%dT%T,%u%z")
;=>"2009-07-30T18:04:36,4-0400"

(format-time-string "%Y-%m-%dT%T,%u%z" nil t)
"2009-07-30T22:05:47,4+0000Z"

(format-time-string "%Y-%m-%dT%T,%u%z" (current-time) t)
;=>"2009-07-30T22:06:10,4+0000"

-----
GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
 of 2009-06-30 on LENNART-69DE564 (patched)

s_P




             reply	other threads:[~2009-07-30 22:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30 22:10 MON KEY [this message]
2009-08-02 23:52 ` Can `format-time-string' produce full/extended ISO 8601 times? Juri Linkov
2009-08-06 18:39   ` MON KEY
2009-08-06 18:47     ` Edward O'Connor
2009-08-06 20:41     ` Juri Linkov

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=d2afcfda0907301510m546ac399te49ddbb966e47ccb@mail.gmail.com \
    --to=monkey@sandpframing.com \
    --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 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.