Search code examples
angularjsangularjs-filter

convert 24 hour time to am/pm using angularjs filter


I have a value

$scope.time = 13:30:00 (in 24 hour format)

Now I want to change this value to am/pm format using angularjs filter like

<th class="text-center">{{time | any filter}}</th>

Output: 1:30 pm

Is there any built in filter or do I have to create custom filter?
how can I use "date" filter to solve this issue?


Solution

  • Try $scope.time = 2016-03-28T13:30:00
    instead of $scope.time = 13:30:00