From Xojo Documentation

Property (As Double )
aDate.TotalSeconds = newDoubleValue
DoubleValue = aDate.TotalSeconds

Supported for all project types and targets.

The number of seconds since 12:00AM, January 1, 1904, local time.


TotalSeconds is the "master" property from which other ways of expressing date/time are derived. A negative value of TotalSeconds indicates a Date/Time prior to January 1, 1904. Very, very large values of TotalSeconds will cause the value to be set to zero.

On Windows (due to the Windows API being used), it is not possible to go back further than 1 January 1601.

Sample Code

You can use TotalSeconds to calculate elapsed seconds:

Dim d1 As New Date
Dim startTime As Double = d1.TotalSeconds
// Do some long process
d2 = New Date
Dim endTime As Double = d2.TotalSeconds
Dim elapsedSeconds = endTime - startTime