TimeSpan

The TimeSpan type is a time interval. It is used to calculate a time interval. The TimeSpan type object methods allow it to be initialized using different time units (hours, minutes, seconds, rates, and so on). The subtraction, summation, and comparison operations are available for TimeSpan objects.

NOTE. Inheritance of class of the TimeSpan basic type is forbidden.

Operators

For two variables containing time, relation operators are available.

Example

Sub SampleTimeSpan;
Var
    d1, d2: DateTime;
    t: TimeSpan;
Begin
    d1 := DateTime.Now;
    Debug.WriteLine(d1);
    t := TimeSpan.Compose(5101511);
    d2 := DateTime.Add(d1, t);
    Debug.WriteLine(d2);
    Debug.WriteLine(t.Hours);
    Debug.WriteLine(t.TotalHours);
End Sub SampleTimeSpan;

See also:

Data Types | TimeSpan Class