PicoXLSX Library Documentation
![]() | 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)

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: StringDate or date and time as Number

Exception | Condition |
---|---|
FormatException | Throws a FormatException if the passed date cannot be translated to the OADate format |

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
