Parsing an xs:duration datatype into a Python datetime.timedelta object?

Posted by Rezzie on Stack Overflow See other posts from Stack Overflow or by Rezzie
Published on 2010-05-04T09:52:04Z Indexed on 2010/05/04 9:58 UTC
Read the original article Hit count: 258

Filed under:
|
|
|
|

As per the title, I'm trying to parse an XML file containing an xs:duration data type. I'd like to convert that into a Python timedelta object, which I can then use in further calculations.

Is there any built-in way of doing this? If not, what is the best way to achieve this?

© Stack Overflow or respective owner

Related posts about python

Related posts about xsd