angular.js - How to format string type time in angularjs
PHPz2017-05-15 17:12:40
0
1
913
The time I got is a string type Feb 21, 2017 5:10:09 PM I want to format this character into "yyyy-MM-dd" It is useless to write like this: {{data.time | date:'yyyy-MM-dd'}} Solve
var time = new Date("Feb 21, 2017 5:10:09 PM") ;
var YMD = $filter('date')(time, 'yyyy-MM-dd');