System.TimeSpan: Method Members

The methods of System.TimeSpan are listed below. For a list of all members, see the TimeSpan Members list.

See Also: Inherited members from System.ValueType

Public Methods

Add(TimeSpan) : TimeSpan

Returns a new TimeSpan object whose value is the sum of the specified TimeSpan object and this instance.

static
Compare(TimeSpan, TimeSpan) : int

Compares two TimeSpan values and returns an integer that indicates whether the first value is shorter than, equal to, or longer than the second value.

CompareTo(object) : int

Compares this instance to a specified object and returns an integer that indicates whether this instance is shorter than, equal to, or longer than the specified object.

CompareTo(TimeSpan) : int

Compares this instance to a specified TimeSpan object and returns an integer that indicates whether this instance is shorter than, equal to, or longer than the TimeSpan object.

Duration() : TimeSpan

Returns a new TimeSpan object whose value is the absolute value of the current TimeSpan object.

override
Equals(object) : bool

Returns a value indicating whether this instance is equal to a specified object.

Equals(TimeSpan) : bool

Returns a value indicating whether this instance is equal to a specified TimeSpan object.

static
Equals(TimeSpan, TimeSpan) : bool

Returns a value that indicates whether two specified instances of TimeSpan are equal.

static
FromDays(double) : TimeSpan

Returns a TimeSpan that represents a specified number of days, where the specification is accurate to the nearest millisecond.

static
FromHours(double) : TimeSpan

Returns a TimeSpan that represents a specified number of hours, where the specification is accurate to the nearest millisecond.

static
FromMilliseconds(double) : TimeSpan

Returns a TimeSpan that represents a specified number of milliseconds.

static
FromMinutes(double) : TimeSpan

Returns a TimeSpan that represents a specified number of minutes, where the specification is accurate to the nearest millisecond.

static
FromSeconds(double) : TimeSpan

Returns a TimeSpan that represents a specified number of seconds, where the specification is accurate to the nearest millisecond.

static
FromTicks(long) : TimeSpan

Returns a TimeSpan that represents a specified time, where the specification is in units of ticks.

override
GetHashCode() : int

Returns a hash code for this instance.

Negate() : TimeSpan

Returns a new TimeSpan object whose value is the negated value of this instance.

static
Parse(string) : TimeSpan

Converts the string representation of a time interval to its TimeSpan equivalent.

static
Parse(string, IFormatProvider) : TimeSpan

Converts the string representation of a time interval to its TimeSpan equivalent by using the specified culture-specific format information.

static
ParseExact(string, string, IFormatProvider) : TimeSpan

Converts the string representation of a time interval to its TimeSpan equivalent by using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

static
ParseExact(string, string[], IFormatProvider) : TimeSpan

Converts the string representation of a time interval to its TimeSpan equivalent by using the specified array of format strings and culture-specific format information. The format of the string representation must match one of the specified formats exactly.

static
ParseExact(string, string, IFormatProvider, System.Globalization.TimeSpanStyles) : TimeSpan

Converts the string representation of a time interval to its TimeSpan equivalent by using the specified format, culture-specific format information, and styles. The format of the string representation must match the specified format exactly.

static
ParseExact(string, string[], IFormatProvider, System.Globalization.TimeSpanStyles) : TimeSpan

Converts the string representation of a time interval to its TimeSpan equivalent by using the specified formats, culture-specific format information, and styles. The format of the string representation must match one of the specified formats exactly.

Subtract(TimeSpan) : TimeSpan

Returns a new TimeSpan object whose value is the difference between the specified TimeSpan object and this instance.

override
ToString() : string

Converts the value of the current TimeSpan object to its equivalent string representation.

ToString(string) : string

Converts the value of the current TimeSpan object to its equivalent string representation by using the specified format.

ToString(string, IFormatProvider) : string

Converts the value of the current TimeSpan object to its equivalent string representation by using the specified format and culture-specific formatting information.

static
TryParse(string, out TimeSpan) : bool
Documentation for this section has not yet been entered.
static
TryParse(string, IFormatProvider, out TimeSpan) : bool
Documentation for this section has not yet been entered.
static
TryParseExact(string, string, IFormatProvider, out TimeSpan) : bool
Documentation for this section has not yet been entered.
static
TryParseExact(string, string[], IFormatProvider, out TimeSpan) : bool
Documentation for this section has not yet been entered.
static
TryParseExact(string, string, IFormatProvider, System.Globalization.TimeSpanStyles, out TimeSpan) : bool
Documentation for this section has not yet been entered.
static
TryParseExact(string, string[], IFormatProvider, System.Globalization.TimeSpanStyles, out TimeSpan) : bool
Documentation for this section has not yet been entered.