How to change date format using date filter in AngularJS?

By Hardik Savani | June 26, 2016 | Category : Angular

AngularJS provides several filter for developing. AngularJS date filter through you can change date format as you want like yyyy-mm-dd, dd-MM-yyyy, MM-dd-yyyy etc. In bellow example you could understand very well date helper to how to use date filter in Angular JS.

In this example i have one array with date(yyyy-mm-dd date format) and date format will be convert into dd-mm-yyyy using date filter.


<html lang="en-US">

<script src=""></script>


<div ng-app="myApp" ng-controller="customersCtrl">






<tr ng-repeat="x in names">

<td>{{ x.language }}</td>

<td>{{ | date: 'dd-MM-yyyy' }}</td>





var app = angular.module('myApp', []);

app.controller('customersCtrl', function($scope, $http) {

$scope.names = [

{'language': 'PHP', 'date': '2016-06-01' },

{'language': 'Laravel', 'date': '2016-06-02'},

{'language': 'Angular JS', 'date': '2016-06-05'},






Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.