Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

william_fu
Contributor II

Convert string into time?

How can convert a string into a timestamp (hh:mm)?

e.g.:

1531 into 15:31

0805 into 08:05

This code doesn't seem to work:

    Time(Time#([String], 'hh:mm') ) AS [StringHour],

After that, how would I combine it with a date to create a date/time column?

Thanks in advance

Tags (3)
1 Solution

Accepted Solutions
pradosh_thakur
Honored Contributor II

Re: Convert string into time?

Time(Time#([String], 'hhmm') ,'hh:mm') AS [StringHour],

Learning never stops.
3 Replies
pradosh_thakur
Honored Contributor II

Re: Convert string into time?

Time(Time#([String], 'hhmm') ,'hh:mm') AS [StringHour],

Learning never stops.
pradosh_thakur
Honored Contributor II

Re: Convert string into time?

for the second part something like this

timestamp(timestamp#(date_field & [StringHour],'DD/MM/YYYYhh:mm')) as date_time


here DD/MM/YYYY I have assumed as date format.

Learning never stops.

Re: Convert string into time?

For second part, this is also possible

TimeStamp(DateField + Time(Time#([String], 'hhmm') ,'hh:mm')) as date_time_field

Community Browser