From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Can `format-time-string' produce full/extended ISO 8601 times? Date: Mon, 03 Aug 2009 02:52:49 +0300 Organization: JURTA Message-ID: <878wi1epta.fsf@mail.jurta.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=shift_jis Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1249261336 8581 80.91.229.12 (3 Aug 2009 01:02:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Aug 2009 01:02:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: MON KEY Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 03 03:02:09 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MXlwH-0001tj-1X for ged-emacs-devel@m.gmane.org; Mon, 03 Aug 2009 03:02:09 +0200 Original-Received: from localhost ([127.0.0.1]:56499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXlwG-0007Zj-Ja for ged-emacs-devel@m.gmane.org; Sun, 02 Aug 2009 21:02:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXltr-0006BK-MC for emacs-devel@gnu.org; Sun, 02 Aug 2009 20:59:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXltm-0006AG-5W for emacs-devel@gnu.org; Sun, 02 Aug 2009 20:59:38 -0400 Original-Received: from [199.232.76.173] (port=41144 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXltk-0006A1-T6 for emacs-devel@gnu.org; Sun, 02 Aug 2009 20:59:32 -0400 Original-Received: from smtp-out1.starman.ee ([85.253.0.3]:33220 helo=mx1.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXltj-0006Lq-VN for emacs-devel@gnu.org; Sun, 02 Aug 2009 20:59:32 -0400 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.68.40.cable.starman.ee [82.131.68.40]) by mx1.starman.ee (Postfix) with ESMTP id A59AD3F4108; Mon, 3 Aug 2009 03:59:24 +0300 (EEST) In-Reply-To: (MON KEY's message of "Thu, 30 Jul 2009 18:10:26 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113584 Archived-At: > 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: =81}hhmm Example: +0100 > =81}hh +01 > > Extended format: =81}hh:mm Example: +01:00 > > -- > 4.2.5.2 Local time and the difference from UTC > > Basic format: hhmmss=81}hhmm Example: 152746+0100 > 152746=81|0500 > hhmmss=81}hh 152746+01 > 152746=81|05 > > Extended format: hh:mm:ss=81}hh:mm Example: 15:27:46+01:00 > 15:27:46=81|05:00 > hh:mm:ss=81}hh 15:27:46+01 > 15:27:46=81|05 > > --- > I am referencing from the .pdf available here: > (URL `http://isotc.iso.org/livelink/livelink/4021199/ISO_8601_2004_E.zip?= func=3Ddoc.Fetch&nodeid=3D4021199') > > ---- > 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") > ;=3D>"2009-07-30T18:04:56-0400" > > (format-time-string "%Y-%m-%dT%T,%u%z") > ;=3D>"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) > ;=3D>"2009-07-30T22:06:10,4+0000" Do you complain that `format-time-string' uses the extended format for date/time and the basic format for time zone? Well, RFC 3339 says: Due to ambiguities in ISO 8601, some interpretations had to be made. First, ISO 8601 is not clear if mixtures of basic and extended format are permissible. And provides a grammar that permits mixtures: time-numoffset =3D ("+" / "-") time-hour [[":"] time-minute] --=20 Juri Linkov http://www.jurta.org/emacs/