System.Xml.Schema.XsdDuration.ToTimeSpan C# (CSharp) Méthode

ToTimeSpan() public méthode

Internal helper method that converts an Xsd duration to a TimeSpan value. This code uses the estimate that there are 365 days in the year and 30 days in a month.
public ToTimeSpan ( ) : System.TimeSpan
Résultat System.TimeSpan
        public TimeSpan ToTimeSpan() {
            return ToTimeSpan(DurationType.Duration);
        }

Same methods

XsdDuration::ToTimeSpan ( DurationType durationType ) : System.TimeSpan

Usage Example

 public static TimeSpan ToTimeSpan(string s)
 {
     XsdDuration duration;
     try
     {
         duration = new XsdDuration(s);
     }
     catch (Exception)
     {
         throw new FormatException(Res.GetString("XmlConvert_BadFormat", new object[] { s, "TimeSpan" }));
     }
     return duration.ToTimeSpan();
 }
All Usage Examples Of System.Xml.Schema.XsdDuration::ToTimeSpan