TimeSpan Members
The TimeSpan type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() |
TimeSpan(Int64) |
Initializes a new instance of the TimeSpan structure to the specified number of ticks.
|
![]() |
TimeSpan(Int32, Int32, Int32) |
Initializes a new instance of the TimeSpan structure to a specified number of hours, minutes, and seconds.
|
![]() |
TimeSpan(Int32, Int32, Int32, Int32) |
Initializes a new instance of the TimeSpan structure to a specified number of days, hours, minutes, and seconds.
|
![]() |
TimeSpan(Int32, Int32, Int32, Int32, Int32) |
Initializes a new instance of the TimeSpan structure to a specified number of days, hours, minutes, seconds, and milliseconds.
|
Methods
Name | Description | |
---|---|---|
![]() |
Add | |
![]() ![]() |
Compare | |
![]() |
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.
|
![]() |
CompareTo(TimeSpan) | |
![]() |
Duration | |
![]() |
Equals(TimeSpan) | |
![]() ![]() |
Equals(TimeSpan, TimeSpan) | |
![]() |
Format(String) | |
![]() |
Format(String, IFormatProvider) | |
![]() ![]() |
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.
|
![]() |
Negate |
Returns a new TimeSpan object whose value is the negated value of this instance.
|
![]() |
Subtract | |
![]() |
ToString(String) |
Converts the value of the current TimeSpan object to its equivalent string representation by using the specified format.
|
![]() |
ToString(String, IFormatProvider) |
Operators
Name | Description | |
---|---|---|
![]() ![]() |
Addition | |
![]() ![]() |
Equality | |
![]() ![]() |
GreaterThan | |
![]() ![]() |
GreaterThanOrEqual | |
![]() ![]() |
Inequality | |
![]() ![]() |
LessThan | |
![]() ![]() |
LessThanOrEqual | |
![]() ![]() |
Subtraction | |
![]() ![]() |
UnaryNegation | |
![]() ![]() |
UnaryPlus |
Fields
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.
|
Properties
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.
|