Mono Class Library: System Namespace

System.TimeSpan Structure

Represents an interval of time. [Edit]

See Also: TimeSpan Members

[System.Runtime.InteropServices.ComVisible(true)]
public struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Remarks

The TimeSpan structure represents an interval of time with values ranging from long.MinValue to long.MaxValue 100-nanosecond ticks.

Note:

The value of a TimeSpan is represented internally as a number of 100-nanosecond ticks. Both the specification of a number of ticks and the value of a TimeSpan can be positive or negative.

A TimeSpan can be represented as a string in the format "[-]d.hh:mm:ss.ff" where "-" is an optional sign for negative TimeSpan values, the "d" component is days, "hh" is hours, "mm" is minutes, "ss" is seconds, and "ff" is fractions of a second. For example, a TimeSpan initialized with 1013 ticks would be represented as "11.13:46:40", which is 11 days, 13 hours, 46 minutes, and 40 seconds.

Due to a varying number of days in months and years, the longest unit of time that is used by this structure is the day.

[Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0