strftime() ISO8601 question.




I'm not sure if I'm misreading things, my implementation has a
'bug' relative to the ISO 8601 standard, or both.

Looking at a number of online references, there seem to be a
large number of possible options for ISO 8601 compliant date and
time strings, depending upon usage. However, the one I am
interested in is for something like a timestamp value,
containing both a date, and a time value. From what I've seen,
the proper representation for that would be something like:

2006-12-23T15:34:15-06:00

Here, the year-month-day, followed by the "T" character to
represent a time following, namely hours:minutes:seconds,
followed by a dash, then the offset from UTS in hours and
minutes.

Looking at strftime, I would expect this format string to yield
the expected results:

"%Y-%m-%dT%H:%M:%S%z"

However, on my implementation (Mac OS X with Xcode 2.4.1 (an IDE
front-end to gcc 4.0.1 as I'm using it), that will yield almost
the correct results, but not quite:

2006-12-23T15:34:15-0600

Note the lack of a ':' separator between the hours and minutes
field (%z) for the UTC offset.

Looking at some logfiles on the system, the latter format
appears in some other places, so I don't think it's the way I'm
calling it. The man page on the platform says the lack of a
delimiter for the offset field is to conform to RFC822 date
headers. Looking at ISO 9899:1999 at the strftime
documentation (7.23.3.5), the same form, without the ':' is
shown. So, is this a case where the C99 standard definition
differs from ISO 8601, and C won out?

It would appear I am using the exact same format string as used
by other developers on the platform.

So, my question is, with respect to ISO 8601, are both forms
valid? I don't have official ISO 8601 documentation, just
references to it via the web.


--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw





.



Relevant Pages

  • Re: man -t odd page size
    ... > ISO compliant document whereas a small minority benefits from having non ... theory shouldn't the FreeBSD lists, docs and code all be in Chinese? ... A4 isn't a DIN standard anymore, ...
    (freebsd-questions)
  • Re: Pixel policy
    ... Or Class Anything compliant? ... If the class is not clearly mentioned the ISO ... According to the ISO standard all LCD screens are sold as Class 1 ... screens unless it is stated clearly and prominently that they are not. ...
    (uk.tech.digital-tv)
  • Re: Why are Digital camera images made wrong?
    ... proportion as usually not as pleasing as the metric paper ratio - it's ... It is an ISO size, but does not divide neatly by 10. ... The international paper size standard, ISO 216, is based on the German DIN 476 standard for paper sizes. ... Successive paper sizes in the series A1, A2, A3, etc., are defined by halving the preceding paper size parallel to its shorter side. ...
    (alt.photography)
  • Re: UTF-8 Erkennung
    ... ISO 8859-1 und ISO-8859-1? ... Charset-Bezeichner dürfen nämlich keine Leerzeichen enthalten. ... Alias: ISO-8859-1 ... Diese Belegung der Steuerzeichen nach ECMA-48, insbesondere die Control-Sets C0 und C1, setzte sich aber zumindest im Computerbereich als Standard tatsächlich durch. ...
    (de.comp.lang.java)
  • Re: Cobol books & experiences
    ... adopted by ISO) ... For the '02 COBOL Standard, ... It went thru the ISO process and ANSI then adopted it. ... Just as ANSI can adopt the current ISO Standard, so can "DIN" (the German ...
    (comp.lang.cobol)