Python 2.3 added a number of simple date and time types in the
datetime
module. There's no support for parsing strings in various
formats and returning a corresponding instance of one of the types.
This PEP proposes adding a family of predefined parsing function for
several commonly used date and time formats, and a facility for generic
parsing.

The types provided by the
datetime
module all have
.isoformat()
and
.ctime()
methods that return string
representations of a time, and the
.strftime()
method can be used
to construct new formats. There are a number of additional
commonly-used formats that would be useful to have as part of the
standard library; this PEP also suggests how to add them.

What exception to raise on errors? ValueError, or a specialized exception?

Should you know what type you're expecting, or should the parsing figure
it out? (e.g.
parse_iso8601("yyyy-mm-dd")
returns a
date
instance,
but parsing "yyyy-mm-ddThh:mm:ss" returns a
datetime
.) Should
there be an option to signal an error if a time is provided where
none is expected, or if no time is provided?

Not all input formats need to be supported as output formats, because it's
pretty trivial to get the
strftime()
argument right for simple things
such as YYYY/MM/DD. Only complicated formats need to be supported;
RFC2822
is currently the only one I can think of.