TimeSpan Structure |
Namespace: System
[SerializableAttribute] public struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, IFormattable
The TimeSpan type exposes the following members.
Name | Description | |
---|---|---|
Equals(Object) | Returns a value indicating whether this instance is equal to a specified object. (Overrides ValueTypeEquals(Object).) | |
Equals(TimeSpan) | Returns a value indicating whether this instance is equal to a specified TimeSpan object. | |
Equals(TimeSpan, TimeSpan) | Returns a value that indicates whether two specified instances of TimeSpan are equal. | |
FromDays | Returns a TimeSpan that represents a specified number of days, where the specification is accurate to the nearest millisecond. | |
FromHours | Returns a TimeSpan that represents a specified number of hours, where the specification is accurate to the nearest millisecond. | |
FromMilliseconds | Returns a TimeSpan that represents a specified number of milliseconds. | |
FromMinutes | Returns a TimeSpan that represents a specified number of minutes, where the specification is accurate to the nearest millisecond. | |
FromSeconds | Returns a TimeSpan that represents a specified number of seconds, where the specification is accurate to the nearest millisecond. | |
FromTicks | Returns a TimeSpan that represents a specified time, where the specification is in units of ticks. | |
GetHashCode | Returns a hash code for this instance. (Overrides ValueTypeGetHashCode.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Parse(String) | Converts the string representation of a time interval to its TimeSpan equivalent. | |
Parse(String, IFormatProvider) | Converts the string representation of a time interval to its TimeSpan equivalent by using the specified culture-specific format information. | |
ToString | Converts the value of the current TimeSpan object to its equivalent string representation. (Overrides ValueTypeToString.) | |
ToString(String) | Converts the value of the current TimeSpan object to its equivalent string representation by using the specified format. | |
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. |
Name | Description | |
---|---|---|
Addition | Adds two specified TimeSpan instances. | |
Equality | Indicates whether two TimeSpan instances are equal. | |
GreaterThan | Indicates whether a specified TimeSpan is greater than another specified TimeSpan. | |
GreaterThanOrEqual | Indicates whether a specified TimeSpan is greater than or equal to another specified TimeSpan. | |
Inequality | Indicates whether two TimeSpan instances are not equal. | |
LessThan | Indicates whether a specified TimeSpan is less than another specified TimeSpan. | |
LessThanOrEqual | Indicates whether a specified TimeSpan is less than or equal to another specified TimeSpan. | |
Subtraction | Subtracts a specified TimeSpan from another specified TimeSpan. | |
UnaryNegation | Returns a TimeSpan whose value is the negated value of the specified instance. |
Name | Description | |
---|---|---|
MaxValue | Represents the maximum TimeSpan value. This field is read-only. | |
MinValue | Represents the minimum TimeSpan value. This field is read-only. | |
TicksPerDay | Represents the number of ticks in 1 day. This field is constant. | |
TicksPerHour | Represents the number of ticks in 1 hour. This field is constant. | |
TicksPerMillisecond | Represents the number of ticks in 1 millisecond. This field is constant. | |
TicksPerMinute | Represents the number of ticks in 1 minute. This field is constant. | |
TicksPerSecond | Represents the number of ticks in 1 second. | |
Zero | Represents the zero TimeSpan value. This field is read-only. |
Name | Description | |
---|---|---|
Days | Gets the days component of the time interval represented by the current TimeSpan structure. | |
Hours | Gets the hours component of the time interval represented by the current TimeSpan structure. | |
Milliseconds | Gets the milliseconds component of the time interval represented by the current TimeSpan structure. | |
Minutes | Gets the minutes component of the time interval represented by the current TimeSpan structure. | |
Seconds | Gets the seconds component of the time interval represented by the current TimeSpan structure. | |
Ticks | Gets the number of ticks that represent the value of the current TimeSpan structure. | |
TotalDays | Gets the value of the current TimeSpan structure expressed in whole and fractional days. | |
TotalHours | Gets the value of the current TimeSpan structure expressed in whole and fractional hours. | |
TotalMilliseconds | Gets the value of the current TimeSpan structure expressed in whole and fractional milliseconds. | |
TotalMinutes | Gets the value of the current TimeSpan structure expressed in whole and fractional minutes. | |
TotalSeconds | Gets the value of the current TimeSpan structure expressed in whole and fractional seconds. |