Skip to content

AngularJS 时间格式化

L edited this page Nov 27, 2017 · 2 revisions

在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

Clone this wiki locally