INFOR.STRING_TO_TIMESTAMP

This function uses a date and adds hours, minutes, seconds, and fractional seconds to it. The result is a timestamp. The third parameter is the level of granularity for the result, for example, at the hour, minute or second level. The fractional seconds are not used.

Syntax

select infor.string_to_timestamp(dateproperty,'hhmmssf')from dataobject

Example

select orderdate,infor.string_to_timestamp(orderdate,'0800000','Hours') as datewithhours, infor.string_to_timestamp(orderdate,'043000','Minutes')  as datewithminutes,infor.string_to_timestamp(orderdate,'03333333','Seconds') datewithseconds from orders

Result:

orderdate, datewithhours,datewithminutes,datewithseconds
2019-07-13, 2019-07-13 08:00:00,2019-07-13-04:30:00, 2019-07-13-03:33:33.000

The first parameter is the date value.

The second parameter value are the hours, minute, and seconds to add to the date. The format is ‘hhmmssf’ where hh are the hours, mm are the minutes and ss are the seconds. Fractional seconds are not used. Enclose the value in single quotes.

The third parameter is the level of granularity of the timestamp result. The options are Hours, Minutes or Seconds. The values are case-sensitive and enclosed with single quotes. ‘Hours’ is based on the hh value. Values for mmssf are not used. ‘Minutes’ is based on the hhmm value. Values for ssf are not used. ‘Seconds’ is based on the hhmmss value. Fractional seconds are not used.