2013-05-14

Parsing ISO 8601 periods

If you have to deal with ISO 8601 duration periods, such as "P1Y2M10DT2H30M", you can just parse it to a TimeSpan using the XmlConvert.ToTimeSpan() method. I'm not sure why this is isn't supported by TimeSpan directly, so thanks to Stack Overflow.

No comments:

Post a Comment