TimeSpan

Object –> ValueType –> TimeSpan

Represents a time interval.
Subtracting one DateTime from another results in a TimeSpan.

Uses

  • Reflecting interval between two dates or times.
  • Measuring elapsed time

Construction

TimeSpan interval = new TimeSpan(); // interval is TimeSpan.Zero.
TimeSpan interval = TimeSpan.Zero;
TimeSpan(hh, mm, ss);
TimeSpan(dd, hh, mm, ss, ms); // ms is optional.
TimeSpan(ticks);
TimeSpan interval = datetime1, datetime2;