[Version: 2024 - September]
[Build: 24.09.03003]
Converts a date to a OLE Automation Date value.
OLE Automation Dates are days counted (positive or negative) from the base date:
30th December 1899 = OLE Automation value '0'.
(datetime date)
Returns the OLE Automation Date value for a specified date.
Example: ToOADate(date(2024, 12, 31)) return OLE Automation Date value for date (45657).
date: Required. The date to be converted to OLE Automation Date format.
(datetime date, bool isSafeCast)
Returns the OLE Automation Date value for a specified date.
Example: ToOADate("Invalid", true) fails with conversion error and returns a default OLE Automation Date value of the date (0).
date: Required. The date to be converted to OLE Automation Date format.
(datetime date, bool isSafeCast, datetime defaultValue)
Returns the OLE Automation Date value for a specified date.
Example: ToOADate("Invalid", true, 45657) fails with conversion error and returns a default OLE Automation Date value of the date (45657).
date: Required. The date to be converted to OLE Automation Date format.
Examples
In this example, I have used TOOADATE in combination with FROMOADATE to result in a date exactly 8 weeks (56 days) ahead in time:
Comments
Please sign in to leave a comment.