on 2015 Sep 23 12:46 PM
Hi I am converting seconds into time and I used the following formula:
=FormatNumber(Floor([Elapsed Time]/3600) ;"0") + ":" +
FormatNumber(Floor(Mod([Elapsed Time];3600)/60);"00") + ":" +
FormatNumber(Mod(Mod([Elapsed Time] ;3600) ;60) ;"00")
The problem I now have is it is giving time as
0:02:50 |
1350:07:59 |
:: |
0:11:15 |
5:05:35 |
359:55:49 |
:: |
0:01:33 |
6:32:38 |
:: |
0:04:20 |
0:25:53 |
3:38:58 |
72:00:04 |
:: |
0:02:32 |
0:16:19 |
3:41:01 |
How do I convert something like second row above 1350:07:59 as days which is 56.
Please help.
Thanks,
Request clarification before answering.
Hi,
Can you try this:
=FormatNumber((Floor([Elapsed Time]/3600)) / 24 ;"0") + ":" + FormatNumber(Mod(Floor([Elapsed Time]/3600),24) ;"0") + ":"
FormatNumber(Floor(Mod([Elapsed Time];3600)/60);"00") + ":" +
FormatNumber(Mod(Mod([Elapsed Time] ;3600) ;60) ;"00")
I have not tested it so it might have some syntax or logical errors.
Regards,
Yuvraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Yuvraj, I have used the below the formula:
=FormatNumber((Floor([Elapsed Time]/3600))/24 ;"0") + ":" +
FormatNumber(Floor(Mod([Elapsed Time];3600)/60);"00") + ":" +
FormatNumber(Mod(Mod([Elapsed Time] ;3600) ;60) ;"00")
and I got the below results. How do I now convert it to a number such as 00.00, so that I can use it for calculation
0:02:50 |
56:07:59 |
:: |
0:11:15 |
0:05:35 |
15:55:49 |
:: |
0:01:33 |
0:32:38 |
:: |
0:04:20 |
0:25:53 |
0:38:58 |
3:00:04 |
:: |
0:02:32 |
0:16:19 |
0:41:01 |
3:00:04 |
Can you try this:
select
case when floor(130805.75/3600) < 10 then '0' || floor(130805.75/3600)
else '' || floor(130805.75/3600)
end
|| ':'||
case when mod(130805.75,3600) = 0 then '00'
when mod(130805.75,3600) > 0 and mod(130805.75,3600) < 600 then '0' || floor(mod(130805.75,3600)/60)
else ''||floor(mod(130805.75,3600)/60)
end
|| ':'||
case when mod(130805.75,3600) = 0 then '00'
when mod(130805.75,60) < 60 and mod(130805.75,60) < 10 then '0'|| floor(mod(130805.75,60))
when mod(130805.75,60) < 60 and mod(130805.75,60) >= 10 then ''|| floor(mod(130805.75,60))
end
from dummy;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
If your elapsed time is already in seconds then use the below formula to convert to days,
= seconds/86400
if your elapsed time is in hh:mm:ss then
(hh*3600) + (mm*60) + (ss) = seconds
seconds/86400 = days
hope this will help you else provide more information
Regards,
Ragoth.C
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rogerio,
My user doesn't want in seconds. He wants the seconds to be days for which I used
=FormatNumber((Floor([Elapsed Time]/3600))/24 ;"0") + ":" +
FormatNumber(Floor(Mod([Elapsed Time];3600)/60);"00") + ":" +
FormatNumber(Mod(Mod([Elapsed Time] ;3600) ;60) ;"00")
and I got below results:
0:02:50 |
56:07:59 |
:: |
0:11:15 |
0:05:35 |
15:55:49 Now I want to convert the above to number so they know it as Days: Hours and I can use the same for calculation |
Hi,
use this to display seconds in the days HH:MM:SS format.
=FormatNumber(Floor([Downtime]/86400);"00") + "Days " +
FormatNumber(Floor(Mod([Downtime] ;86400)/3600);"00") + ":" +
FormatNumber(Floor(Mod(Mod([Downtime] ;86400);3600)/60);"00") + ":" +
FormatNumber(Mod(Mod(Mod([Downtime] ;86400) ;3600) ;60);"00")
Amit
Hi,
I would insist that the best approach is use the results in seconds , make your clculation and then use the result to convert back to days, hours, minutes and seconds.
Like you have the execution time of 2,000,000 seconds for one item and
1,000,000 to another.
Take the difference between these two numbers (1,000,000) and convert it to days , hours, minutes and seconds which gives you with the following result :
days | hours | minutes | seconds |
11 | 13 | 46 | 40 |
Regards,
Rogerio
Hi Chaz,
Create a variable as
seconds= days* 86400 (eg: for 1.5 days seconds= 1.5*86400=129600)
Then write formula as
=FormatNumber(Floor([seconds]/3600);"00") + ":" + (seconds/3600 )
FormatNumber(Floor(Mod([seconds] ;3600)/60);"00") + ":" + ( mod(seconds,3600)/60 )
FormatNumber(mod(mod([seconds],3600),60);"00") (mod(mod(seconds,3600)/,60)
Regards,
Ragoth.C
User | Count |
---|---|
87 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.