How to: |
The HNAME function extracts a specified component value from a timestamp, in date-time format, and returns it as digits, in alphanumeric format.
HNAME(timestamp, 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 extracted.
For a list of valid components, see Date and Time Components For Date and Date-Time Functions.
Alphanumeric, at least A2
The function converts a component value to a string of digits. The year is always four digits, and the hour assumes the 24-hour system.
Assuming that the current time obtained by the function HGETC in the first parameter is 13:22:11, this example returns the string '13' and assigns it to AHOUR:
AHOUR/A2 = HNAME(HGETC(8,'HYYMDS'),'HOUR', AHOUR);
iWay Software |