momentjs格式时间,每分钟分别为一分钟 [英] momentjs format time in seperate hours an minutes
本文介绍了momentjs格式时间,每分钟分别为一分钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在angular js中使用momentjs,并以秒为单位计算持续时间,我可以将其格式化为 HH:mm
的格式为 03:35
,但是我找不到文档以及Google如何显示 3h 35m
格式的文件?有人可以将我指向正确的文档吗?
I use momentjs inside angular js and I acount the duration in seconds and I can format it in HH:mm
format as 03:35
but I cannot find in documentaion and google to how show it in format 3h 35m
could anybody point me to right documentation???
推荐答案
这应该得到您想要的:
moment().format("H[h] mm[m]");
看看momement.js文档中的格式. []
用于转义格式字符串中的字符.
Take a look at Format from the momement.js docs. The []
is used to escape characters in format strings.
这篇关于momentjs格式时间,每分钟分别为一分钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文