Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
soha1902
Creator
Creator

Convert HH:MM:SS into seconds


Hi All,

I have one field named "Duration" which contains the time values in HH:MM:SS format (like 00:12:36). I want to convet these values in Seconds. Please suggest me.

Thanks.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Do you want to format it to display seconds (assuming Duration is a valid time value?

     =Interval(Duration, 'ss')

Or assuming it is a string?

     =Interval(Time#(Duration), 'HH:MM:SS'), 'ss')

Or do you want to convert it to seconds (assuming it is a valid time value)

     =Duration * 86400

Or convert it (assuming it is a string)

     =Time#(Duration, 'HH:MM:SS') * 86400

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
arulsettu
Master III
Master III

hi

try this

=Interval(Time#('00:12:36','hh:mm:ss'),'ss')

thimma_paul
Contributor III
Contributor III

For Seconds =Interval(Time#('00:12:36','hh:mm:ss'),'ss')

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Do you want to format it to display seconds (assuming Duration is a valid time value?

     =Interval(Duration, 'ss')

Or assuming it is a string?

     =Interval(Time#(Duration), 'HH:MM:SS'), 'ss')

Or do you want to convert it to seconds (assuming it is a valid time value)

     =Duration * 86400

Or convert it (assuming it is a string)

     =Time#(Duration, 'HH:MM:SS') * 86400

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein