HTMTOTS: Converting a Time to a Timestamp

How to:

The HTMTOTS function returns a timestamp using the current date to supply the date components of its value, and copies the time components from its input date-time value.


Top of page

x
Syntax: How to Convert a Time to a Timestamp
HTMTOTS(time, length, output)

where:

time

Date-Time

Is the date-time value whose time will be used. The date portion will be ignored.

length

Integer

Is the length of the result. This can be one of the following:

8 for input time values including milliseconds.
10 for input time values including microseconds.

12 for input time values including nanoseconds.

output_format

Date-Time

Is the timestamp whose date is set to current date, and whose time is copied from time.



Example: Converting a Time to a Timestamp

This example produces a timestamp, whose date and time are current, and stores the result in a column with the format in the field HMDYYS:

HMDYYS = HTMTOTS(DT(&MYTOD), 8, 'HMDYYS');

The result is 03/26/2004 13:48:14.


iWay Software