Skip to main content

Hi,

 

i want to convert a value (seconds) into DD:HH:MM:SS

 

I used this Formular i found:

 

STR(INT(SUM([Duration])/3600))

+ ":" +

IF INT(SUM([Duration])%3600/60)

< 10 THEN "0" ELSE "" END + STR(INT(SUM([Duration])%3600/60))

+ ":" +

IF INT(SUM([Duration]) %3600 %60)

< 10 THEN "0" ELSE "" END + STR(INT(SUM([Duration])%3600 %60))

 

But it is a freakshow.

Some are correct, some are not.

 

See Screenshot attached.

 

Any Idea?

 

2 answers
  1. Feb 26, 2020, 11:22 PM

    Hi Leo

     

    It's difficult to tell what's going on without a workbook; but, you can check out the following which should point you the right direction.  http://drawingwithnumbers.artisart.org/formatting-time-durations/   Best Don

     

    You'll need to SUM your seconds first.  Then use the following calc, based on the SUM([Seconds]) calc:

     

    //replace [Seconds] with whatever field has the number of seconds in it

    //and use a custom number format of 00:00:00:00 (drop the first 0 to get rid of leading 0's for days)

    IIF([Seconds] % 60 == 60,0,[Seconds] % 60)// seconds

    + IIF(INT([Seconds]/60) %60 == 60, 0, INT([Seconds]/60) %60) * 100 //minutes

    + IIF(INT([Seconds]/3600) % 24 == 0, 0, INT([Seconds]/3600) % 24) * 10000 //hours

    + INT([Seconds]/86400) * 1000000 // days

0/9000