Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
hlines_usacs
Creator II
Creator II

Duration between two timestamps in hours, minutes, and seconds

Hello, I have two dates (timestamps) and I want to find the duration between the two in the format of hours, minutes, and seconds. For example: 4 hours, 6 minutes, 3 seconds.

Does anyone know how to do this?

Thanks!

1 Solution

Accepted Solutions
sunny_talwar

For the format, you can do this

=Replace(Replace(Replace(Interval(Now() - Today(), 'h@, mm#, ss$'), '@', ' hours'), '#', ' minutes'), '$', ' seconds')

View solution in original post

3 Replies
sunny_talwar

May be use Interval() function

Interval(TimeStamp2 - TimeStamp1, 'hh:mm:ss')

sunny_talwar

For the format, you can do this

=Replace(Replace(Replace(Interval(Now() - Today(), 'h@, mm#, ss$'), '@', ' hours'), '#', ' minutes'), '$', ' seconds')

View solution in original post

undergrinder
Specialist II
Specialist II

Sunny is right, I can only append thatm you can format the string furhter with date function:

=date(interval(date2-date1','s'),'hh mm ss')