Re: Question about ISO8601 vs. strftime()
- From: Randy Howard <randyhoward@xxxxxxxxxxxxxxxxx>
- Date: Sun, 24 Dec 2006 03:51:19 GMT
On Sat, 23 Dec 2006 21:27:29 -0600, Ian Woods wrote
(in article <Xns98A32331FB75Cnewspub3atwuggydotor@xxxxxxxxxxxxxxx>):
So, my question is, with respect to ISO 8601, are both forms
valid? Or is the strftime() one actually correct, and a slew of
online references to ISO8601 just get it wrong? I don't have
official ISO 8601 documentation, just references to it via the
web.
I don't have a copy of the real ISO 8601 either. AFAIK, both the forms
with and without separators are allowed and equivalent. This certainly
seems to be the case from a number of sources including:
http://www.cl.cam.ac.uk/~mgk25/iso-time.html
Unless I missed something, that link only shows the form with the UTC
offset without the ':' separator. It shows regular time such as hh:mm,
but not the offset as far as I can tell.
http://en.wikipedia.org/wiki/ISO_8601 (looking at the "formats" on the
RHS)
Again, I don't see it used that way in the examples there for the UTC
offset value. BTW, I tried editing in a comment about the
inconsistencies between the wiki entry and the C99 standard
description, and it was summarily expunged within a few minutes. Makes
wiki suspect, when questions of technical accuracy are deleted, rather
than clarified, especially when it happens so quickly, and nothing is
said even on the discussion page.
http://hydracen.com/dx/iso8601.htm
This link definitely shows several forms for the UTC offset, including
the 'short form' I haven't seen before of hours only.
Since there are so many variations, it somewhat calls into question the
value of using such a loose standard, as it doesn't exactly make it
easier on the "consumer" of the data, which still has to know how to
interpret all the variations. Oh well, I guess I'll stick with this
specifier, which seems to match most platform utilities that attempt a
date at least similar to ISO8601:
"%Y-%m-%dT%H:%M:%S%z"
That said, people seem to dislike the "T" notation for the time
component, usually resulting in this variation being used instead:
"%Y-%m-%d %H:%M:%S%z"
--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw
.
- Follow-Ups:
- Re: Question about ISO8601 vs. strftime()
- From: Ian Woods
- Re: Question about ISO8601 vs. strftime()
- References:
- Question about ISO8601 vs. strftime()
- From: Randy Howard
- Re: Question about ISO8601 vs. strftime()
- From: Ian Woods
- Question about ISO8601 vs. strftime()
- Prev by Date: Re: Question about ISO8601 vs. strftime()
- Next by Date: Re: need general help about "real-life programming"
- Previous by thread: Re: Question about ISO8601 vs. strftime()
- Next by thread: Re: Question about ISO8601 vs. strftime()
- Index(es):
Relevant Pages
|