.net - How to Convert ISO 8601 Duration to TimeSpan in VB.Net? -


is there standard library method converts string has duration in standard iso 8601 duration (also used in xsd duration type) format .net timespan object?

for example, p0dt1h0m0s represents duration of 1 hour, converted new timespan(0,1,0,0,0).

a reverse converter exist works follows: xml.xmlconvert.tostring(new timespan(0,1,0,0,0)) above expression return p0dt1h0m0s.

this convert xs:duration timespan:

system.xml.xmlconvert.totimespan("p0dt1h0m0s") 

see http://msdn.microsoft.com/en-us/library/system.xml.xmlconvert.totimespan.aspx


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -