
Test if the variable is a date
Member of String Intrinsic Functions (PRIM_LIBI.IStringIntrinsics)
Parameters
Name | Type | Data Type | Description |
---|---|---|---|
Result | *Result (Optional) | Boolean | True if the variable is a valid date |
Format | *Input (Optional) | Enumeration | Format of the date |
Details
IsDate will return True if the variable can be converted to a valid date in the specified format. IsDate will often be used before AsDate to better handle potential date errors.
Allowed Formats
IsDate has many available formats. See the Feature Viewer (F2) or autocomplete in the IDE for additional information.
Example
In this example, IsDate expects a variable the format MMDDYY
If (#Variable.IsDate(MMDDYY) #Date := #Variable.AsDate(MMDDYY) Endif
See also
LANSA Version 15, April 2020