String Intrinsic Functions - AsTime Method

Return the variable as a time

Member of String Intrinsic Functions (PRIM_LIBI.IStringIntrinsics)


NameTypeData TypeDescription
Result*Result (Optional)TimeResulting time
Format*Input (Optional)EnumerationFormat of the time


AsTime will return a time based on the value of the variable and the specified format.
If the supplied value does not conform to the required format, the application will end with a run time error.
Use the IsTime intrinsic to test the value before attempting to convert to a time.

Allowed Formats

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


In this example, if the variable contained "113045", the result would be a time of 11:30:45. Eleven hours, 30 minutes and 45 seconds.
If (#Variable.IsTime(hhmmss))
   #Time := #Variable.AsTime(hhmmss)

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2