TimeSpan Members
The following tables list the members exposed by the TimeSpan type.
Public Constructors
Name | Description | |
---|---|---|
TimeSpan | Overloaded. Initializes a new instance of the TimeSpan structure. |
Public Fields
Name | Description | |
---|---|---|
MaxValue | Represents the largest possible value for a TimeSpan object. Note that this field is read-only. | |
MinValue | Represents the smallest possible value for a TimeSpan object. Note that this field is read-only. | |
TicksPerDay | Specifies the number of ticks in one entire day. Note that the value of this field is constant. | |
TicksPerHour | Specifies the number of ticks in one hour. Note that the value of this field is constant. | |
TicksPerMillisecond | Specifies the number of ticks in one millisecond. Note that the value of this field is constant. | |
TicksPerMinute | Specifies the number of ticks in one minute. Note that the value of this field is constant. | |
TicksPerSecond | Specifies the number of ticks in one second. Note that the value of this field is constant. | |
Zero | A TimeSpan having a value of 0 (zero). Note that this field is read-only. |
Public Properties
Name | Description | |
---|---|---|
Days | Gets the number of whole days in the current TimeSpan object (time period). | |
Hours | Gets the number of whole hours in the current TimeSpan object (time period). | |
Milliseconds | Gets the number of whole milliseconds in the current TimeSpan object (time period). | |
Minutes | Gets the number of whole minutes in the current TimeSpan object (time period). | |
Seconds | Gets the number of whole seconds in the current TimeSpan object (time period). | |
Ticks | Gets the number of ticks in the current TimeSpan object (time period). |
Public Methods
Name | Description | |
---|---|---|
Add | Adds a specified TimeSpan object (time period) to the current TimeSpan object, yielding a new TimeSpan object. | |
Compare | Compares two specified TimeSpan objects (time periods) with one another to determine their relative value. | |
CompareTo | Compares a specified TimeSpan object (time period) or other time-period object with the current TimeSpan object to determine their relative value. | |
Duration | Returns a new TimeSpan object (time period) that has the absolute value of the current TimeSpan object. | |
Equals | Overloaded. Determines whether two objects that specify time periods are equal. | |
FromTicks | Returns a TimeSpan object (time period) that is equivalent to a specified number of ticks. | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
Negate | Returns a new TimeSpan object that has the negated (opposite) value of the current TimeSpan object. | |
op_UnaryNegation | Returns a TimeSpan whose value is the negated value of the specified instance. | |
op_UnaryPlus | Returns the specified instance of TimeSpan. | |
operator - | Subtracts a specified TimeSpan object (time period) from another specified TimeSpan object, yielding a new TimeSpan object. | |
operator != | Determines whether two specified TimeSpan objects (time periods) are not equal. | |
operator + | Adds two specified TimeSpan objects (time periods), yielding a new TimeSpan object. | |
operator + | Unary plus operator. | |
operator < | Determines whether a specified TimeSpan object (time period) is less than another specified TimeSpan object. | |
operator <= | Determines whether a specified TimeSpan object (time period) is less than or equal to another specified TimeSpan object. | |
operator == | Determines whether two specified TimeSpan objects (time periods) are equal. | |
operator > | Determines whether a specified TimeSpan object (time period) is greater than another specified TimeSpan object. | |
operator >= | Determines whether a specified TimeSpan object (time period) is greater than or equal to another specified TimeSpan object. | |
ReferenceEquals | (Inherited from Object.) | |
Subtract | Subtracts a specified TimeSpan object (time period) from the current TimeSpan object, yielding a new TimeSpan object. | |
ToString | Converts the value of the current TimeSpan object (time period) to its equivalent string representation. |