Mono Class Library: Overview

System.TimeSpan: Members

The members of System.TimeSpan are listed below.

See Also: Inherited members from System.ValueType

Public Constructors

Constructs and initializes a new TimeSpan with the specified number of ticks.
Constructs and initializes a new TimeSpan with the specified numbers of hours, minutes, and seconds.
Constructs and initializes a new TimeSpan with the specified numbers of days, hours, minutes, and seconds.
Constructs and initializes a new TimeSpan with the specified numbers of days, hours, minutes, seconds, and milliseconds.

Public Fields

static readonly
MaxValueTimeSpan. Returns a TimeSpan whose value is the maximum value for the TimeSpan type.
static readonly
MinValueTimeSpan. Returns a TimeSpan whose value is the minimum value for the TimeSpan type.
const
TicksPerDaylong (864000000000). Represents the number of ticks in 1 day.
const
TicksPerHourlong (36000000000). Represents the number of ticks in 1 hour.
const
TicksPerMillisecondlong (10000). Represents the number of ticks in 1 millisecond.
const
TicksPerMinutelong (600000000). Represents the number of ticks in 1 minute.
const
TicksPerSecondlong (10000000). Represents the number of ticks in 1 second.
static readonly
ZeroTimeSpan. Returns a TimeSpan whose value is 0.

Public Properties

[read-only]
Daysint. Gets the number days represented by the current instance.
[read-only]
Hoursint. Gets the number of hours represented by the current instance.
[read-only]
Millisecondsint. Gets the number of milliseconds represented by the current instance.
[read-only]
Minutesint. Gets the number of minutes represented by the current instance.
[read-only]
Secondsint. Gets the number of seconds represented by the current instance.
[read-only]
Tickslong. Gets the number of ticks represented by the current instance.
[read-only]
TotalDaysdouble. Gets the value of the current instance expressed in days.
[read-only]
TotalHoursdouble. Gets the value of the current instance expressed in hours.
[read-only]
TotalMillisecondsdouble. Gets the value of the current instance expressed in milliseconds.
[read-only]
TotalMinutesdouble. Gets the value of the current instance expressed in minutes.
[read-only]
TotalSecondsdouble. Gets the value of the current instance expressed in seconds.

Public Methods

Add(TimeSpan) : TimeSpan
Adds the specified TimeSpan to the current instance.
static
Compare(TimeSpan, TimeSpan) : int
Returns the sort order of two TimeSpan structures.
CompareTo(object) : int
Returns the sort order of the current instance compared to the specified object.
CompareTo(TimeSpan) : int
Returns the sort order of the current instance compared to the specified TimeSpan.
Duration() : TimeSpan
Returns a TimeSpan whose value is the absolute value of the current instance.
override
Equals(object) : bool
Determines whether the current instance and the specified object represent the same type and value.
Equals(TimeSpan) : bool
Determines whether the current instance and the specified TimeSpan represent the same value.
static
Equals(TimeSpan, TimeSpan) : bool
Determines whether two TimeSpan structures represent the same type and value.
static
FromDays(double) : TimeSpan
Returns a TimeSpan that represents the specified number of days where the specification is accurate to the nearest millisecond.
static
FromHours(double) : TimeSpan
Returns a TimeSpan that represents the specified number of hours where the specification is accurate to the nearest millisecond.
static
FromMilliseconds(double) : TimeSpan
Returns a TimeSpan that represents the specified number of milliseconds where the specification is accurate to the nearest millisecond.
static
FromMinutes(double) : TimeSpan
Returns a TimeSpan that represents the specified number of minutes where the specification is accurate to the nearest millisecond.
static
FromSeconds(double) : TimeSpan
Returns a TimeSpan that represents the specified number of seconds where the specification is accurate to the nearest millisecond.
static
FromTicks(long) : TimeSpan
Returns a TimeSpan that represents the specified number of ticks.
override
GetHashCode() : int
Generates a hash code for the current instance.
Negate() : TimeSpan
Returns a TimeSpan with the same absolute value but opposite sign as the current instance.
static
Parse(string) : TimeSpan
Returns the specified string converted to a TimeSpan value.
Subtract(TimeSpan) : TimeSpan
Subtracts the value of the specified TimeSpan from the value of the current instance.
override
ToString() : string
Returns a string representation of the value of the current instance.
static
TryParse(string, out TimeSpan) : bool
Documentation for this section has not yet been entered.

Public Operators

static
Addition(TimeSpan, TimeSpan)Adds the values of two TimeSpan instances.
static
Equality(TimeSpan, TimeSpan)Determines whether the value of one TimeSpan is equal to the value of another TimeSpan.
static
GreaterThan(TimeSpan, TimeSpan)Determines whether the value one TimeSpan is greater than the value of another TimeSpan.
static
GreaterThanOrEqual(TimeSpan, TimeSpan)Determines whether the value of one TimeSpan is greater than or equal to the value of another TimeSpan.
static
Inequality(TimeSpan, TimeSpan)Determines whether the value of one TimeSpan is unequal to the value of another TimeSpan.
static
LessThan(TimeSpan, TimeSpan)Determines whether the value of one TimeSpan is less than the value of another TimeSpan.
static
LessThanOrEqual(TimeSpan, TimeSpan)Determines whether the value of one TimeSpan is less than or equal to the value of another TimeSpan.
static
Subtraction(TimeSpan, TimeSpan)Subtracts the value of one TimeSpan from the value of another TimeSpan.
static
UnaryNegationReturns a TimeSpan whose value is the negated value of a specified TimeSpan.
static
UnaryPlusReturns the specified instance of TimeSpan.