Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
TimeSpan Methods

TimeSpan Methods

The TimeSpan type exposes the following members.

  Name Description
Public method Supported by the XNA Framework Supported by Portable Class Library Add Returns a new TimeSpan object whose value is the sum of the specified TimeSpan object and this instance.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library Compare 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.
Public method Supported by the XNA Framework CompareTo(Object) 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.
Public method Supported by the XNA Framework Supported by Portable Class Library CompareTo(TimeSpan) 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.
Public method Supported by the XNA Framework Supported by Portable Class Library Duration Returns a new TimeSpan object whose value is the absolute value of the current TimeSpan object.
Public method Supported by the XNA Framework Supported by Portable Class Library Equals(Object) Returns a value indicating whether this instance is equal to a specified object. (Overrides ValueType.Equals(Object).)
Public method Supported by the XNA Framework Supported by Portable Class Library Equals(TimeSpan) Returns a value indicating whether this instance is equal to a specified TimeSpan object.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library Equals(TimeSpan, TimeSpan) Returns a value that indicates whether two specified instances of TimeSpan are equal.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library FromDays Returns a TimeSpan that represents a specified number of days, where the specification is accurate to the nearest millisecond.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library FromHours Returns a TimeSpan that represents a specified number of hours, where the specification is accurate to the nearest millisecond.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library FromMilliseconds Returns a TimeSpan that represents a specified number of milliseconds.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library FromMinutes Returns a TimeSpan that represents a specified number of minutes, where the specification is accurate to the nearest millisecond.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library FromSeconds Returns a TimeSpan that represents a specified number of seconds, where the specification is accurate to the nearest millisecond.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library FromTicks Returns a TimeSpan that represents a specified time, where the specification is in units of ticks.
Public method Supported by the XNA Framework Supported by Portable Class Library GetHashCode Returns a hash code for this instance. (Overrides ValueType.GetHashCode().)
Public method Supported by the XNA Framework Supported by Portable Class Library GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Supported by the XNA Framework Supported by Portable Class Library Negate Returns a new TimeSpan object whose value is the negated value of this instance.
Public method Static member Supported by the XNA Framework Supported by Portable Class Library Parse(String) Converts the string representation of a time interval to its TimeSpan equivalent.
Public method Static member Supported by Portable Class Library Parse(String, IFormatProvider) Converts the string representation of a time interval to its TimeSpan equivalent by using the specified culture-specific format information.
Public method Static member Supported by Portable Class Library ParseExact(String, String, IFormatProvider) 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.
Public method Static member Supported by Portable Class Library ParseExact(String, String[], IFormatProvider) 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.
Public method Static member Supported by Portable Class Library ParseExact(String, String, IFormatProvider, TimeSpanStyles) 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.
Public method Static member Supported by Portable Class Library ParseExact(String, String[], IFormatProvider, TimeSpanStyles) 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.
Public method Supported by the XNA Framework Supported by Portable Class Library Subtract Returns a new TimeSpan object whose value is the difference between the specified TimeSpan object and this instance.
Public method Supported by the XNA Framework Supported by Portable Class Library ToString() Converts the value of the current TimeSpan object to its equivalent string representation. (Overrides ValueType.ToString().)
Public method Supported by Portable Class Library ToString(String) Converts the value of the current TimeSpan object to its equivalent string representation by using the specified format.
Public method Supported by Portable Class Library ToString(String, IFormatProvider) Converts the value of the current TimeSpan object to its equivalent string representation by using the specified format and culture-specific formatting information.
Public method Static member Supported by Portable Class Library TryParse(String, TimeSpan) Converts the string representation of a time interval to its TimeSpan equivalent and returns a value that indicates whether the conversion succeeded.
Public method Static member Supported by Portable Class Library TryParse(String, IFormatProvider, TimeSpan) Converts the string representation of a time interval to its TimeSpan equivalent by using the specified culture-specific formatting information, and returns a value that indicates whether the conversion succeeded.
Public method Static member Supported by Portable Class Library TryParseExact(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, and returns a value that indicates whether the conversion succeeded. The format of the string representation must match the specified format exactly.
Public method Static member Supported by Portable Class Library TryParseExact(String, String[], IFormatProvider, TimeSpan) Converts the specified string representation of a time interval to its TimeSpan equivalent by using the specified formats and culture-specific format information, and returns a value that indicates whether the conversion succeeded. The format of the string representation must match one of the specified formats exactly.
Public method Static member Supported by Portable Class Library TryParseExact(String, String, IFormatProvider, 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, and returns a value that indicates whether the conversion succeeded. The format of the string representation must match the specified format exactly.
Public method Static member Supported by Portable Class Library TryParseExact(String, String[], IFormatProvider, TimeSpanStyles, TimeSpan) Converts the specified string representation of a time interval to its TimeSpan equivalent by using the specified formats, culture-specific format information, and styles, and returns a value that indicates whether the conversion succeeded. The format of the string representation must match one of the specified formats exactly.
Top

  Name Description
Explicit interface implemetation Private method Supported by Portable Class Library IComparable.CompareTo Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Top
Show:
© 2015 Microsoft