Version

DateTimeToExcelDate(Workbook,DateTime) Method

Converts a DateTime to Excel's numerical representation of a date.
Syntax
'Declaration
 
Public Overloads Shared Function DateTimeToExcelDate( _
   ByVal workbook As Workbook, _
   ByVal dateValue As System.Date _
) As System.Nullable(Of Double)
public static System.Nullable<double> DateTimeToExcelDate( 
   Workbook workbook,
   System.DateTime dateValue
)

Parameters

workbook
dateValue
The DateTime value to convert to the Microsoft Excel date format.
Remarks

When using the 1900 date system in Excel, dates before 3/1/1900 must be corrected, because Excel incorrectly assumes 1900 is a leap year. This overload assumes the 1900 date system is being used as so it corrects the date values.

Requirements

Target Platforms: Windows 8.1, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

View on GitHub