You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Number Intrinsic Functions - AsTime Method
Return the variable as a time
Member of Number Intrinsic Functions (PRIM_LIBI.INumberIntrinsics)

Parameters

Name

Type

Data Type

Description

Result

*Result (Optional)

Time

Resulting time

Format

*Input (Optional)

Enumeration

Format of the time

Details


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 Value

Description

HHMMSS

e.g. "113045"

Seconds

Number of seconds since 00:00:00

Example


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)
Endif

See also

All Component Classes
Technical Reference

  • No labels