Click or drag to resize
NanoXLSX

UtilsGetDateFromOA Method

Method to calculate a common Date from the OA date (OLE automation) 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

Namespace: NanoXLSX
Assembly: NanoXLSX (in NanoXLSX.dll) Version: 2.6.3+98f265239ae8df4639650ecd7029244cc5e52dfc
Syntax
C#
public static DateTime GetDateFromOA(
	double oaDate
)

Parameters

oaDate  Double
oaDate OA date number

Return Value

DateTime
Converted date
Remarks
Numbers that represents dates before 1900-03-01 (number of days since 1900-01-01 = 60) are automatically modified. Until 1900-03-01 is 1.0 added to the number to get the same date, as displayed in Excel.The reason for this is a bug in Excel. See also: https://docs.microsoft.com/en-us/office/troubleshoot/excel/wrongly-assumes-1900-is-leap-year
See Also