Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

adding a zero on single digit time

New Here ,
Oct 01, 2012 Oct 01, 2012

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?

540
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 01, 2012 Oct 01, 2012
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources