Convert second into hh:mm (hours: Minutes)

Radhe
Tera Expert

Hi All,

Please advise how to convert duration result from second to hh:mm:ss (hours: Minutes: second).

find_real_file.png

On change script-

find_real_file.png

Script include -

find_real_file.png

 

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Radhe,

 

Replace line 8 in script include with below.

var h = Math.floor(dur / 3600);
var m = Math.floor(dur % 3600 / 60);
var s = Math.floor(dur % 3600 % 60);
var finalis=h +':'+m+':'+':'+s;

return finalis;

View solution in original post

10 REPLIES 10

Could you suggest what script i need to add if I need duration in days instead of HH:MM:SS?

Hi Radhe,

 

Add below updated line in script.

var h = Math.floor(dur / (3600*24));

Mark correct and helpful based on impact.

Thanks,

Dhananjay.

It's working but format is showing HH:MM:SS Could you suggest how to make it in days format. Like 1 day, 10 Days.

find_real_file.png 

 

Hi,

You need to remove other lines.

var h = Math.floor(dur / (3600*24));

var finalis=h;

return finalis;

 

I hope above lines will do trick for you.

Mark correct and helpful based on impact.

Thanks,

Dhananjay.

Radhe
Tera Expert

Thank you so much Sir!!!