Unicode Intrinsic Functions - IsDateTime Method

Test if the variable is a datetime

Member of Unicode Intrinsic Functions (PRIM_LIBI.IUnicodeIntrinsics)

Parameters

NameTypeData TypeDescription
Result*Result (Optional)BooleanTrue if the variable is a valid datetime
Format*Input (Optional)EnumerationFormat of the datetime

Details

IsDateTime will return True if the variable can be converted to a valid datetime in the specified format.
 
IsDateTime will often be used before AsDateTime to better handle potential errors.

Allowed Formats

Enum ValueDescription
CCYYDDMMHHMMSSe.g. "20153105113045"
CCYYMMDDHHMMSSe.g. "20150531113045"
HHMMSSDDMMCCYYe.g. "11304531052015"
HHMMSSDDMMYYe.g. "113045310515"
ISOe.g. "2015-05-31 11:30:45"
Localized_SQLe.g. "2015-05-31 11:30:45"
SQLe.g. "2015-05-31 11:30:45"
TZe.g. "2015-05-20T01:16:05Z" or "2015-05-20T01:18:17+10:00" if appending the UTC offset

Example

In this example, IsDateTime expects a variable in the format CCYYMMDDHHMMSS
If (#Variable.IsDateTime(CCYYMMDDHHMMSS)
   #Datetime := #Variable.AsDateTime(CCYYMMDDHHMMSS)
Endif

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2