public override bool Equals(object obj) { Iso8601Duration other = obj as Iso8601Duration; if (null == other) { return(false); } long otherTicks = other.ToTimeSpan().Ticks; long ticks = ToTimeSpan().Ticks; return(otherTicks == ticks); }
public static TimeSpan XmlSchemaDurationToTimeSpan(string duration) { // return SoapDuration.Parse(duration); // // This would be the .NET built-in helper // but I examined the code using Reflector and // I don't like it as much as mine. // For what it's worth, the SoapDuration Parse method // converts years to 360 days, // months to 30 days, and ignores weeks Iso8601Duration iso8601Duration = Iso8601Duration.Parse(duration); return(iso8601Duration.ToTimeSpan()); }
public static TimeSpan ToTimeSpan(Iso8601Duration duration) { return duration.ToTimeSpan(); }
public static TimeSpan ToTimeSpan(Iso8601Duration duration) { return(duration.ToTimeSpan()); }