System.Windows.Forms.AxHost.GetOADateFromTime Method

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

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
protected static double GetOADateFromTime (DateTime time)

Parameters

time
The DateTime structure to translate.

Returns

A double-precision floating-point number that contains an OLE Automation date equivalent to specified time value.

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 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 DateTime.MaxValue, the last moment of 31 December 9999.

For more information about OLE Automation, see the tp://go.microsoft.com/fwlink/?linkid=37118.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0