Unicode Intrinsic Functions - IsTime Method

Test if the variable is a valid time

Member of Unicode Intrinsic Functions (PRIM_LIBI.IUnicodeIntrinsics)


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


IsTime will return True if the variable can be converted to a valid time using the specified format.
IsTime will often be used before AsTime to better handle potential errors.

Allowed Formats

Enum ValueDescription
HHMMSS e.g. "113045"
HHsMMsSS e.g. "11:30:45"
ISO e.g. "11:30:45"


In this example, #Variable is tested to ensure it's in the format HHMMSS before being assigned to #Result
If (#Variable.IsTime(HHMMSS))
   #Result := #Variable.AsTime(HHMMSS)

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020