Parsing ISO date/time strings - where did the parser go?

Ben Finney ben+python at benfinney.id.au
Tue Sep 11 12:00:06 EDT 2012


Roy Smith <roy at panix.com> writes:

> In article <mailman.473.1347317852.27098.python-list at python.org>,
>  Chris Angelico <rosuav at gmail.com> wrote:
> > What is it that takes up forty pages [for the ISO 8601
> > specification]? RFC 2822 describes a date/time stamp in about two
> > pages. In fact, the whole RFC describes the Internet Message Format
> > in not much more than 40 pages. Is ISO-language just bloated?
> > 
> > *boggle*
>
> You can find a copy at http://dotat.at/tmp/ISO_8601-2004_E.pdf

In brief: ISO 8601 doesn't have the luxury of a single timestamp format.
It also must define its terms from a rather more fundamental starting
point than RFC 5822 can assume.

There's some bloat (5 of the 40 pages don't even show up in the table of
contents), but much of the content of the ISO 8601 standard is required,
to cover the ground intended in the level of detail intended.

    Scope

    This International Standard is applicable whenever representation of
    dates in the Gregorian calendar, times in the 24-hour timekeeping
    system, time intervals and recurring time intervals or of the
    formats of these representations are included in information
    interchange. It includes

    * calendar dates expressed in terms of calendar year, calendar month
      and calendar day of the month;

    * ordinal dates expressed in terms of calendar year and calendar day
      of the year;

    * week dates expressed in terms of calendar year, calendar week number
      and calendar day of the week;

    * local time based upon the 24-hour timekeeping system;

    * Coordinated Universal Time of day;

    * local time and the difference from Coordinated Universal Time;

    * combination of date and time of day;

    * time intervals;

    * recurring time intervals.

-- 
 \       “First things first, but not necessarily in that order.” —The |
  `\                                              Doctor, _Doctor Who_ |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list