ColdFusion - Create Time from Number of Minutes

醉酒当歌 提交于 2019-12-19 16:47:26

问题


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))


来源:https://stackoverflow.com/questions/10146820/coldfusion-create-time-from-number-of-minutes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!