Skip to main content
Participating Frequently
October 1, 2012
Question

adding a zero on single digit time

  • October 1, 2012
  • 1 reply
  • 545 views

Im wanting to convert seconds to hours, mins, secs. This code works fine

<cfset Time = '#int((seconds/60)/60)#:' & '#(seconds/60) MOD 60#:' & '#seconds MOD 60#'>

but if there is a single digit it only displays one eg 1:1:1 whereas I would prefer to have 01:01:01. How can I add a 0 in if its a sigle digit number?

    This topic has been closed for replies.

    1 reply

    Inspiring
    October 1, 2012