SpreadsheetGear 2023
DateTimeToNumber Method (IWorkbook)


SpreadsheetGear Namespace > IWorkbook Interface : DateTimeToNumber Method
The System.DateTime instance to convert.
Converts the specified System.DateTime to a date-time serial number appropriate for storage in a worksheet cell.
Syntax
'Declaration
 
Function DateTimeToNumber( _
   ByVal dateTime As System.Date _
) As System.Double
'Usage
 
Dim instance As IWorkbook
Dim dateTime As System.Date
Dim value As System.Double
 
value = instance.DateTimeToNumber(dateTime)
System.double DateTimeToNumber( 
   System.DateTime dateTime
)

Parameters

dateTime
The System.DateTime instance to convert.

Return Value

A date-time serial number appropriate for storage in a worksheet cell.
Remarks

Dates and times are stored in worksheet cells as a date-time serial number.

This method is safe to use from custom functions.

Requirements

Target Platforms: 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

Reference

IWorkbook Interface
IWorkbook Members
NumberToDateTime Method
Date1904 Property