time module & ISO dates

Fred L. Drake, Jr. fdrake at acm.org
Tue Feb 1 17:39:24 CET 2000


Gerald Gutierrez writes:
 > Is there any way to get the standard Python time module to properly parse full
 > ISO-8601 dates, such as "2000-01-31T22:07:43-0800"? strptime() ALMOST
 > does what is needed but it does not provide for parsing the UTC offset at the
 > end (the "-0800").

Gerald,
  I don't know the answer to the second part of your question, but for 
the first part, the PyXML package (additional information at
http://www.python.org/sigs/xml-sig/) includes a module
"xml.utils.iso8601" that supports ISO-8601 dates somewhat more
flexibly than just the W3C's profile specifies.  It doesn't support
dates by week or date ranges.
  If you find any bugs in the module, please let me know.


  -Fred

--
Fred L. Drake, Jr.	  <fdrake at acm.org>
Corporation for National Research Initiatives




More information about the Python-list mailing list