This documentation is archived and is not being maintained.

AxHost.GetTimeFromOADate Method

Returns a DateTime structure that corresponds to the specified OLE Automation date.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

protected static DateTime GetTimeFromOADate(
	double date
)

Parameters

date
Type: System.Double
The OLE Automate date to translate.

Return Value

Type: System.DateTime
A DateTime that represents the same date and time as date.

ExceptionCondition
ArgumentException

The date is not a valid OLE Automation Date value.

The date parameter is a double-precision floating-point number that represents a date as the number of days before or after the base date, midnight, 30 December 1899. The sign and integral part of date encode the date as a positive or negative day displacement from 30 December 1899, and the absolute value of the fractional part of date encodes the time of day as a fraction of a day displacement from midnight. date must be a value between negative 657435.0 through positive 2958466.0.

Note that because of the way dates are encoded, there are two ways of representing any time of day on 30 December 1899. For example, -0.5 and 0.5 both mean noon on 30 December 1899 because a day displacement of plus or minus zero days from the base date is still the base date, and a half day displacement from midnight is noon.

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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