Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
SatyaPaleti
Creator III
Creator III

How to convert seconds in to DD:HH:MM:SS format

Hi Folks,

How can we convert seconds in to DD:HH:SS format

for example I am having 20400062 seconds. How can we show this in to Days Hours Minutes seconds format  DD:HH:MM:SS

Could you please help on this

Thanks and Regards,

Satya

22 Replies
SatyaPaleti
Creator III
Creator III
Author

Thank you so much Tresco

I have a requirement. the above number(20400062) I have shown is in Minutes I want to convert Minutes in to Days. But day have only 8 hours. How can we do this

SatyaPaleti
Creator III
Creator III
Author

No Viswanath. I tried it. It's working fine

SatyaPaleti
Creator III
Creator III
Author

Vishwanath I have Tried this. But in some cases it's not working much

=Floor(180/60/60/24) &' Days '  & Interval(frac(180/60/60/24),'hh:mm:ss'). Iam getting out put  0 days 00:03:00.

Is it 0 days 3 Mins

SatyaPaleti
Creator III
Creator III
Author

Can you please modify the formula if any change required

SatyaPaleti
Creator III
Creator III
Author

=Floor(1500/60/60/24) &' Days '  & Interval(frac(1500/60/60/24),'hh:mm:ss')

Out put is 0 days 00:25:00 but in this case out put should be 3 days 1 hour

sunny_talwar

Try this

=Floor(1500/60/8) & ' Days ' & Interval(Frac(1500/60/8)/3, 'h') & ' hours ' & Num(SubField(Interval(Frac(1500/60/8)/3, 'h:mm'), ':', -1)) & ' minutes'


Capture.PNG

vishsaggi
Champion III
Champion III

Yes bcoz your minutes are lesser may be try this? Fieldname here is your actual field where you have these mintures.

= IF(Fieldname < 3600, Interval(Fieldname/60/24, 'd hh:mm:ss'), Interval(Fieldname/60/60/24, 'd hh:mm:ss'))

SatyaPaleti
Creator III
Creator III
Author

Thank you Sunny

SatyaPaleti
Creator III
Creator III
Author

I will try it Viswanath. Thank you for help

pradosh_thakur
Master II
Master II

Hi Ppaleti

go through this thread

https://community.qlikview.com/thread/150930

hopefully it will help.

regards

Pradosh

Learning never stops.