HINPUT: Converting an Alphanumeric String to a Date-Time Value

How to:

The HINPUT function converts an alphanumeric string to a date-time value.


Top of page

x
Syntax: How to Convert an Alphanumeric String to a Date-Time Value
HINPUT(source_length, 'source_string', output_length, output)

where:

source_length

Integer

Is the number of characters in the source string to be converted.

source_string

Alphanumeric

Is the string to be converted.

output_length

Integer

Is the length of the returned date-time value. Valid values are:

  • 8 indicates a time value that includes one to three decimal digits (milliseconds).
  • 10 indicates a time value that includes four to six decimal digits (microseconds).
  • 12 indicates a time value that includes seven to nine decimal digits (nanoseconds).
output

Date-time

Is the returned date-time value.



Example: Converting an Alphanumeric String to a Timestamp

This example,

DTM/HYYMDS = HINPUT(14, '20040229 13:34:00', 8, DTM);

converts the character string (20040229 13:34:00) into a timestamp, which is then assigned to the date-time field DTM. DTM is displayed as 2004/02/29 13:34:00.


iWay Software