.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
Post a Comment