Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Convert from decimal to duration (HH:MM:SS)

How can I convert decimal to duration format?

 

response timetarget response time
00:30:002,50
01:00:000,433
02:00:001,133

 

I want to convert the column "target response time" to the format of the column "response time".

Example:  2,50 must be converted to 02:30:00

 

Thank you.

  • duration = [target response time] / 24

    cast the calculated column to type "Time"

5 Replies

  • CNENFRNL's avatar
    CNENFRNL
    Icon for Community Champion rankCommunity Champion
    duration = [target response time] / 24

    cast the calculated column to type "Time"

    • Anonymous's avatar
      Anonymous
      Not applicable

      This worked for me. Now, I need to figure how to get them to return a sum in a Matrix. Currently, I cannot select sum of the duration in a Matrix. It only allows me to select first or count. 

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    @anlu20 Maybe:

    Column = FORMAT(INT([Column1]),"00") & ":" & FORMAT(([Column1] - INT([Column1])) * 60,"00") & ":00"
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You could try the following formula to create column:

    Time Column =
    VAR _totalseconds = [target response time] * 3600
    VAR _hour =
        INT ( [target response time] )
    VAR _min =
        INT ( ( _totalseconds - _hour * 3600 ) / 60 )
    VAR _sec = _totalseconds - _hour * 3600 - _min * 60
    RETURN
        TIME ( _hour, _min, _sec )
    

    After change the data type and format type, the final output is shown below:

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Can you let me know whether this answer worked for you or not please?

    If it worked ok, please mark as the solution to help people with similar problems find the answer quicker.

     

    Best Regards,
    Eyelyn Qin