Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DateTime.FromOADate Method

Returns a DateTime equivalent to the specified OLE Automation Date.

[Visual Basic]
Public Shared Function FromOADate( _
   ByVal d As Double _
) As DateTime
[C#]
public static DateTime FromOADate(
 double d
);
[C++]
public: static DateTime FromOADate(
 double d
);
[JScript]
public static function FromOADate(
   d : double
) : DateTime;

Parameters

d
An OLE Automation Date value.

Return Value

A DateTime that represents the same date and time as d.

Exceptions

Exception Type Condition
ArgumentException The date is not a valid OLE Automation Date value.

Remarks

d must be a value between negative 657435.0 through positive 2958466.0. It is stored as a double-precision floating-point number.

See ToOADate and the MSDN Online Library at http://MSDN.Microsoft.com/library/default.asp for more information on OLE Automation.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

DateTime Structure | DateTime Members | System Namespace | ToOADate

Show:
© 2017 Microsoft