FROMOADATE

[Version: 2024 - September]
[Build: 24.09.03003] 

Converts a OLE Automation Date value to a date.

OLE Automation Dates are days counted (positive or negative) from the base date:
30th December 1899 = OLE Automation value '0'. 

(int oaDate)
Returns the date representation based on the total amount of ticks passed as parameter.
Example: FromOADate(45657) returns date representation of the date (December 31, 2024).
oaDate: Required. The numeric value of the date in OLE Automation Date format.

 

(int oaDatebool isSafeCast)
Returns the date representation based on OLE Automation Date format passed as parameter.
Example: FromOADate(99999999999999999999999999999, true) returns a default date representation of the date (January 1, 0001).
oaDate: Required. The numeric value of the date in OLE Automation Date format.

 

(int oaDatebool isSafeCastdatetime defaultValue)
Returns the date representation based on OLE Automation Date format passed as parameter.
Example: FromOADate(99999999999999999999999999999, true, date(2024, 12, 31)) fails with conversion error and returns a default value of the date (December 31, 2024).
oaDate: Required. The numeric value of the date in OLE Automation Date format.

 

Examples

In this example, I have used FROMOADATE in combination with TOOADATE to result in a date exactly 8 weeks (56 days) ahead in time:

 

 

 

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.