This documentation is archived and is not being maintained.
TimeSpan Members
.NET Framework 3.0
Represents a time interval.
The following tables list the members exposed by the TimeSpan type.
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 number of whole days represented by the current TimeSpan structure. | |
Hours | Gets the number of whole hours represented by the current TimeSpan structure. | |
Milliseconds | Gets the number of whole milliseconds represented by the current TimeSpan structure. | |
Minutes | Gets the number of whole minutes represented by the current TimeSpan structure. | |
Seconds | Gets the number of whole seconds 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. |
Name | Description | |
---|---|---|
Add | Adds the specified TimeSpan to this instance. | |
Compare | Compares two TimeSpan values and returns an integer that indicates their relationship. | |
CompareTo | Overloaded. Compares this instance to a specified object or TimeSpan and returns an indication of their relative values. | |
Duration | Returns a new TimeSpan object whose value is the absolute value of the current TimeSpan object. | |
Equals | Overloaded. Overridden. Returns a value indicating whether two 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 | Overridden. Returns a hash code for this instance. | |
GetType | Gets the Type of the current instance. (inherited from Object) | |
Negate | Returns a TimeSpan whose value is the negated value of this instance. | |
op_Addition | Adds two specified TimeSpan instances. | |
op_Equality | Indicates whether two TimeSpan instances are equal. | |
op_GreaterThan | Indicates whether a specified TimeSpan is greater than another specified TimeSpan. | |
op_GreaterThanOrEqual | Indicates whether a specified TimeSpan is greater than or equal to another specified TimeSpan. | |
op_Inequality | Indicates whether two TimeSpan instances are not equal. | |
op_LessThan | Indicates whether a specified TimeSpan is less than another specified TimeSpan. | |
op_LessThanOrEqual | Indicates whether a specified TimeSpan is less than or equal to another specified TimeSpan. | |
op_Subtraction | Subtracts a specified TimeSpan from another specified TimeSpan. | |
op_UnaryNegation | Returns a TimeSpan whose value is the negated value of the specified instance. | |
op_UnaryPlus | Returns the specified instance of TimeSpan. | |
Parse | Constructs a new TimeSpan object from a time interval specified in a string. | |
ReferenceEquals | Determines whether the specified Object instances are the same instance. (inherited from Object) | |
Subtract | Subtracts the specified TimeSpan from this instance. | |
ToString | Overridden. Returns the string representation of the value of this instance. | |
TryParse | Constructs a new TimeSpan object from a time interval specified in a string. Parameters specify the time interval and the variable where the new TimeSpan object is returned. |
Show: