LowLevel.GetOADateTimeString Method

PicoXLSX

PicoXLSX

LowLevelGetOADateTimeString Method

Method to convert a date or date and time into the internal Excel time format (OAdate)

Namespace:  PicoXLSX
Assembly:  PicoXLSX (in PicoXLSX.dll) Version: 2.4.0.0 (2.4.0)
Syntax
C#
public static string GetOADateTimeString(
	DateTime date,
	CultureInfo culture
)

Parameters

date
Type: SystemDateTime
Date to process
culture
Type: System.GlobalizationCultureInfo
CultureInfo for proper formatting of the decimal point

Return Value

Type: String
Date or date and time as Number
Exceptions
ExceptionCondition
FormatExceptionThrows a FormatException if the passed date cannot be translated to the OADate format
Remarks
OA Date format starts at January 1st 1900 (actually 00.01.1900). Dates beyond this date cannot be handled by Excel under normal circumstances and will throw a FormatException
See Also