Class TimePeriod
A collection of utility methods for creation Timespan with support for ISO8601 duration format.
public static class TimePeriod
- Inheritance
-
TimePeriod
- Inherited Members
Methods
ValueOf(string)
Returns TimeSpan with represented with a given string. Allowable format is ISO8601 duration, but there are some simplifications and modifications available:
- Letters are case insensitive.
- Letters "P" and "T" can be omitted.
- Letter "S" can be also omitted. In this case last number will be supposed to be seconds.
- Number of seconds can be fractional. So it is possible to define duration accurate within milliseconds.
- Every part can be omitted. It is supposed that it's value is zero then.
- String "inf" recognized as unlimited period.
public static TimeSpan ValueOf(string value)
Parameters
value
stringThe string representation.
Returns
- TimeSpan
The time span that represented with a given string.