Want to convert a number field into hh:mm:ss in a calculation field

Comments

3 comments

  • Jayraj Berde

    I don't have a start date and a end date & time here. I just have the number of seconds available to calculate. 

    0
    Comment actions Permalink
  • Rainer Grabowski

    Hi Jayraj

    this should do it:

    var secTotal = @duration;
    var secHr = 3600;
    var secMin = 60;
    hr = parseInt(secTotal/secHr);
    min = parseInt((secTotal%secHr)/secMin);
    sec =parseInt((secTotal%secHr)%secMin);
    hr + ":" + min + ":" + sec

    Rainer

    0
    Comment actions Permalink
  • Jayraj Berde

    Thanks Rainer, you are the man. Works perfectly.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk