ColdFusion - Create Time from Number of Minutes

2020-04-04 09:40发布

问题:

I have the number of minutes (ie. 25, 120, 300, etc) entered by the user, and I need to display it in a h:mm:ss format. Are there any built-in ColdFusion functions that can do this for me, or does anyone have any suggestions about the easiest way to build out the string?

回答1:

<cfset totaltime = "#totalminutes\60#:#numberformat(totalminutes % 60, "00")#:00" />


回答2:

Kinda late to the game, but this works pretty nicely:

TimeFormat(CreateTimeSpan(0,0,minutes,0))