Export (0) Print
Expand All
Expand Minimize

DateTime.ToOADate Method

Converts the value of this instance to the equivalent OLE Automation date.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

public double ToOADate ()
public double ToOADate ()
public function ToOADate () : double

Return Value

A double-precision floating-point number that contains an OLE Automation date equivalent to the value of this instance.

Exception typeCondition

OverflowException

The value of this instance cannot be represented as an OLE Automation Date.

An OLE Automation date is implemented as a floating-point number whose value is the number of days from midnight, 30 December 1899. For example, midnight, 31 December 1899 is represented by 1.0; 6 A.M., 1 January 1900 is represented by 2.25; midnight, 29 December 1899 is represented by -1.0; and 6 A.M., 29 December 1899 is represented by -1.25.

The base OLE Automation Date is midnight, 30 December 1899. The maximum OLE Automation Date is the same as MaxValue, the last moment of 31 December 9999.

For more information about OLE Automation, see the MSDN Library.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft