How to: |
The HPART function extracts a specified component value from a timestamp, in date-time format, and returns it in numeric format.
HPART(value, component, output_format)
where:
Date-Time
Is the timestamp from which a component value is to be extracted.
Alphanumeric
Is the name of the component to be incremented. For a list of valid components, see Date and Time Components For Date and Date-Time Functions.
Integer
Assuming that the current time obtained by HGETC in the first parameter is 14:01:39, this example returns a whole number, 14, and assigns it to IHOUR:
IHOUR/I2 = HPART(HGETC(8,'HYYMDS'),'HOUR', IHOUR);
iWay Software |