Skip to main content
February 3, 2008
Answered

Is there a function to format time without being a real time?

  • February 3, 2008
  • 1 reply
  • 308 views
What I mean is I would like to display the elapsed time (which can grow more than 24 hours by the way in some cases) and express it in format of HH:mm. I created a function that does that but I have a bit of difficulties with the minutes since I decided to take the amount (which is the total in minutes) and divided by 60 to get the number of hours. Naturally, it will be a modulo number in most of the case but this number is a fraction and not anymore a - time value -. Maybe I am just sleepy since I am working a lot recently but I just turning around with that idea and I cannot imagine I am the only one who have this need in the world so I guess there is a function somewhere!!!

I know it is possible to do it in JavaScript but I would prefer in ColdFusion to be used from the server-side.

Thank's for any hint!
    This topic has been closed for replies.
    Correct answer
    Since my need was concerning a factor of 15 minutes (15, 30, 45, 60), I decided to simplify my function to that level and now it works. See the code to learn more about this as it can serve somebody else.

    1 reply

    Correct answer
    February 3, 2008
    Since my need was concerning a factor of 15 minutes (15, 30, 45, 60), I decided to simplify my function to that level and now it works. See the code to learn more about this as it can serve somebody else.