Parse XML, date formats (PT0H0M0S,PT2920H0M0S)



I'm trying to parse an xml-file exported from MS Project 2013 using python and it contains the following data:



<TimephasedData>
<Type>1</Type>
<UID>4628</UID>
<Start>2014-09-22T08:00:00</Start>
<Finish>2015-09-22T08:00:00</Finish>
<Unit>8</Unit>
<Value>PT2920H0M0S</Value>
</TimephasedData>
<TimephasedData>
<Type>1</Type>
<UID>4628</UID>
<Start>2015-09-22T08:00:00</Start>
<Finish>2015-09-23T08:00:00</Finish>
<Unit>2</Unit>
<Value>PT8H0M0S</Value>
</TimephasedData>


What I don't understand is what the PT8H0M0S and PT2920H0M0S represents (TimephasedData). Currently I parse the dates by replacing the character "T" and then use strptime


No comments:

Post a Comment