ColdFusion - 日期和时间格式化为5分钟

Jes*_*ley 1 coldfusion datetime mura

我有以下日期字符串:

2017-05-02 08:00:00.0 
Run Code Online (Sandbox Code Playgroud)

当我应用datetimeformat()时:

 #datetimeformat(item.getValue('releasedate'), 'h:mm a')#
Run Code Online (Sandbox Code Playgroud)

它正在向上舍入5分钟并输出:上午8:05.在上面的代码中,'releasedate'是传入的字符串.

我该如何解决?

CBr*_*roe 13

没人在四舍五入.您输出的是月份而不是分钟,月份恰好是5月,因此05前导零.

https://cfdocs.org/datetimeformat:

mm:月份为数字; 单位数月份领先零.

会议纪要不在mm这里,但是

nn: 分钟; 单位数分钟的前导零