all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Can `format-time-string' produce full/extended ISO 8601 times?
@ 2009-07-30 22:10 MON KEY
  2009-08-02 23:52 ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: MON KEY @ 2009-07-30 22:10 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-08-06 20:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-30 22:10 Can `format-time-string' produce full/extended ISO 8601 times? MON KEY
2009-08-02 23:52 ` Juri Linkov
2009-08-06 18:39   ` MON KEY
2009-08-06 18:47     ` Edward O'Connor
2009-08-06 20:41     ` Juri Linkov

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.