TimeSpan

TimeSpan


This class represents an amount of time.


Implements:

IComparable 
IFormattable 
IObject 

Public:

Properties:

NameDescription
 Days (get) Returns the Days portion of the duration.  
 Hours (get) Returns the Hours portion of the duration.  
 Milliseconds (get) Returns the Milliseconds portion of the duration.  
 Minutes (get) Returns the Minutes portion of the duration.  
 Seconds (get) Returns the Seconds portion of the duration.  
 Ticks (get) Returns the duration in ticks.  
 TotalDays (get) Returns the duration of this instance in days.  
 TotalHours (get) Returns the duration of this instance in hours.  
 TotalMilliseconds (get) Returns the duration of this instance in milliseconds.  
 TotalMinutes (get) Returns the duration of this instance in minutes.  
 TotalSeconds (get) Returns the duration of this instance in seconds.  

Methods:

NameDescription
 Add Adds a timespan to this instance.  
 CompareTo Compares this TimeSpan with another timespan.  
 Duration Returns the absolute value of this instance.  
 Equals Returns a boolean indicating if the value and this TimeSpan instance are the same value.  
 GetHashCode Returns a pseudo-unique number identifying this instance.  
 Negate Returns a TimeSpan with the opposite sign of this instance.  
 Subtract Subtracts a timespan from this instance.  
 ToString Converts the value of the current TimeSpan object to its equivalent string representation by using the specified format and culture-specific formatting information.  

Remarks

The time is represented internally in milliseconds, with a fractional portion to represent ticks. A tick is defined as 100 nanoseconds, or 1/10000 of a millisecond. TimeSpans are displayed in a [-][d.]hh:mm:ss[.ff] format. Bracketed fields are only displayed if they are not zero. A negative sign is displayed if the timespan is negative.

See Also

Project CorLib Overview

Class TimeSpan Overview

Constructors

TimeSpanStatic

CorDateTime