AngularJS 时间格式化

在AngularJs的controller里面进行格式化

vm.firstTime = $filter('date')(data.data, "yyyy-MM-dd hh:mm:ss"); 

在html中进行格式化

{{vm.secondTime | date:'yyyy-MM-dd hh:mm:ss'}}

示例代码:
https://github.com/zLulus/NotePractice/blob/dev3/Website/NotePractice/Views/AngularjsStudy/TimeFormat.cshtml
详细格式说明:
http://www.jianshu.com/p/b25beea3d9ca

posted @ 2017-11-27 16:04  Lulus  阅读(387)  评论(0编辑  收藏  举报