Re: Question about ISO8601 vs. strftime()



Randy Howard <randyhoward@xxxxxxxxxxxxxxxxx> wrote in
news:0001HW.C1B3468A0030F467F0203648@xxxxxxxxxxxxxxxx:

<snip>

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 same 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.

<snip>

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
http://en.wikipedia.org/wiki/ISO_8601 (looking at the "formats" on the
RHS)
http://hydracen.com/dx/iso8601.htm

It also appears to be permitted by the attempted ABNF grammar described
here:

http://www.imc.org/ietf-calendar/archive1/msg00501.html

Of course, each of these references could all be wrong, but I think
that's somewhat unlikely! :)

Ian Woods
.



Relevant Pages

  • RE: 5.3-RELEASE-i386-disc2.iso
    ... Nero has the annoying habit of caching files smaller than 64K with the ... Bootonly ISO helps you to boot up the system and enable the network cards so ... the Miniinst ISO is a complete FreeBSD installation ...
    (freebsd-questions)
  • Re: Why tthe header is not declared ?
    ... different systems has any relevance to ISO C. ... with streams only within the subset of file-handling techniques that ISO ... character set, and if you run them through appropriate filters when moving ...
    (comp.lang.c)
  • Re: Could You help me? (c++, winapi)
    ... I'd like to get time in miliseconds of working some algorithms. ... snip ... ... goals using only the facilities guaranteed by the ISO C standard? ...
    (comp.programming)
  • Re: Problems dvd burning on Sony DRU700A
    ... > succesfully recorded a DVD+RW with a 3.9 GB iso. ... Is it suddenly not needed to 'enable DMA' anymore? ...
    (comp.os.linux.misc)
  • Re: Aptitude remembers CD-ROMs under Etch
    ... when I put back references to the ISO files, ... and aptitude still wants to install ... My CD-ROM drive mounts at /cdrom, but the Etch ISO images are loop-mounted ... aptitude still wants to install packages from /cdrom. ...
    (Debian-User)