How to use angular js date filter?

AngularJS date filter is used to convert a date into a specified format. When the date format is not specified, the default date format is ‘MMM d, yyyy’.



        <div ng-app=”gfgApp” ng-controller=”dateCntrl”> 

            <p>{{ today | date : “dd.MM.y” }}</p> 



            var app = angular.module(‘gfgApp’, []); 

            app.controller(‘dateCntrl’, function($scope) { 

                $ = new Date(); 





This code gives the current date with filter value. It will display the date into a respective format.