asp.net.ph

DateTime.ToOADate Method

System Namespace   DateTime Structure


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

[ VB ]
<Serializable>
Public Function ToOADate ( ) As Double

[ C# ]
[ Serializable ]
public double ToOADate ( );

[ C++ ]
[ Serializable ]
public: double ToOADate ( );

[ JScript ]
public Serializable
function ToOADate ( ) : double;

Return Value

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

Exceptions


Exception Type Condition
OverflowException The value of this instance cannot be represented as an OLE Automation Date.

Remarks

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 represented by -1.0; and 6 A.M., 29 December 1899 represented by -1.25.

Only DateTime objects with a tick value that is greater than or equal to positive or negative 31241376000000000 can be represented as an OLE Automation Date. An uninitialized DateTime, that is, an instance with a tick value of 0, is converted to an equivalent uninitialized OLE Automation Date, that is, a date with a value of 0.0 which represents midnight, 30 December 1899.

NOTE: The Ticks value of a DateTime is between MinValue and MaxValue.

NOTE: The maximum value of a DateTime is equal to the maximum value of an OLE Automation Date.

See FromOADate and the MSDN Online Libary at http://msdn.microsoft.com/library/default.asp for more information about OLE Automation.

See Also

DateTime Members   Double   FromOADate Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph