如何使用moment.js提取时间?
"2015-01-16T12:00:00"
它应该返回“12:00:00 pm”。
返回的字符串将传递到下面的时间选择器控件。
http://jdewit.github.com/bootstrap-timepicker
任何的想法?
最佳答案
如果您阅读文档(http://momentjs.com/docs/#/displaying/),则可以找到以下格式:
moment("2015-01-16T12:00:00").format("hh:mm:ss a")
参见JS小提琴http://jsfiddle.net/Bjolja/6mn32xhu/