AngularJS | date Filter Last Updated : 21 Jan, 2022 Suggest changes Share 1 Likes Like Report 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'. Syntax: {{ date | date : format : timezone }} Parameter Values: The date filter contains format and timezone parameters which is optional.Some common values used in format are as follow: 'yyyy' - define year ex. 2019'yy' - define year ex. 19'y' - define year ex. 2019'MMMM' - define month ex. April'MMM' - define month ex. Apr'MM' - define month ex. 04'dd' - define day ex. 09'd' - define day ex. 9'hh' - define hour in AM/PM'h' - define hour in AM/PM'mm' - define minute'm' - define minute'ss' - define second's' - define second Some predefined values for format are as follow: "short" - equivalent to "M/d/yy h:mm a""medium" - equivalent to "MMM d, y h:mm:ss a""shortDate" - equivalent to "M/d/yy" (5/7/19)"mediumDate" - equivalent to "MMM d, y" (May 7, 2019)"longDate" - equivalent to "MMMM d, y" (May 7, 2019)"fullDate" - equivalent to "EEEE, MMMM d, y" (Tuesday, May 7, 2019)"shortTime" - equivalent to "h:mm a" (2:35 AM)"mediumTime" - equivalent to "h:mm:ss a" (2:35:05 AM) Example 1: This example display the date in given format. html <!DOCTYPE html> <html> <head> <title>Date Filter</title> <script src= "https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"> </script> </head> <body> <div ng-app="gfgApp" ng-controller="dateCntrl"> <p>{{ today | date : "dd.MM.y" }}</p> </div> <script> var app = angular.module('gfgApp', []); app.controller('dateCntrl', function($scope) { $scope.today = new Date(); }); </script> </body> </html> Output: 07.05.2019 Example 2: This example display the time in specified format. html <!DOCTYPE html> <html> <head> <title>Date Filter</title> <script src= "https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"> </script> </head> <body> <div ng-app="gfgApp" ng-controller="dateCntrl"> <p>{{ today| date : 'mediumTime'}}</p> </div> <script> var app = angular.module('gfgApp', []); app.controller('dateCntrl', function($scope) { $scope.today = new Date(); }); </script> </body> </html> Output: 2:37:23 AM Example 3: This example display the date in specified format. html <!DOCTYPE html> <html> <head> <title>Date Filter</title> <script src= "https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"> </script> </head> <body> <div ng-app="gfgApp" ng-controller="dateCntrl"> <p>{{ today| date }}</p> </div> <script> var app = angular.module('gfgApp', []); app.controller('dateCntrl', function($scope) { $scope.today = new Date(); }); </script> </body> </html> Output: May 7, 2019 A aman neekhara Follow 1 Article Tags : AngularJS Explore AngularJS BasicsAngularJS Tutorial 5 min read Introduction to AngularJS 4 min read Angular CLI | Angular Project Setup 3 min read AngularJS Expressions 2 min read AngularJS Modules 3 min read AngularJS ng-model Directive 4 min read AngularJS Data Binding 4 min read AngularJS Controllers 3 min read AngularJS | Scope 2 min read AngularJS Services 4 min read AngularJS | AJAX - $http 3 min read AngularJS | Tables 2 min read AngularJS Select Boxes 2 min read AngularJS SQL 3 min read AngularJS HTML DOM 2 min read AngularJS Events 3 min read AngularJS | Forms 3 min read AngularJS Form Validation 3 min read AngularJS | API 2 min read AngularJS and W3.CSS 2 min read AngularJS Includes 3 min read AngularJS Animations 1 min read AngularJS | Application 3 min read AngularJS DirectivesAngularJS Directives 9 min read AngularJS ng-app Directive 1 min read AngularJS ng-bind Directive 2 min read AngularJS ng-bind-html Directive 2 min read AngularJS ng-bind-template Directive 2 min read AngularJS ng-blur Directive 1 min read AngularJS ng-change Directive 2 min read AngularJS ng-checked Directive 2 min read AngularJS ng-class Directive 2 min read AngularJS ng-class-even Directive 2 min read AngularJS ng-class-odd Directive 2 min read AngularJS ng-click Directive 2 min read AngularJS ng-cloak Directive 2 min read AngularJS ng-controller Directive 2 min read AngularJS Directives Complete Reference 2 min read AngularJS FiltersAngularJS | Filters 7 min read AngularJS currency Filter 2 min read AngularJS | date Filter 2 min read AngularJS filter Filter 3 min read AngularJS json Filter 2 min read AngularJS limitTo Filter 2 min read AngularJS lowercase Filter 1 min read AngularJS number Filter 1 min read AngularJS orderBy Filter 4 min read AngularJs uppercase Filter 1 min read AngularJS Converting FunctionsAngularJS angular.lowercase() Function 2 min read AngularJS angular.uppercase() Function 1 min read AngularJS angular.forEach() Function 1 min read AngularJS Comparing FunctionsAngularJS angular.isArray() Function 2 min read AngularJS angular.isDate() Function 2 min read AngularJS angular.isDefined() Function 2 min read AngularJS angular.isElement() Function 2 min read AngularJS angular.isFunction() Function 2 min read AngularJS angular.isNumber() Function 2 min read AngularJS angular.isObject() Function 2 min read AngularJS | angular.isString() Function 1 min read AngularJS angular.isUndefined() Function 2 min read AngularJS angular.equals() Function 2 min read AngularJS angular.toJson() Function 2 min read AngularJS QuestionsHow to bundle an Angular app for production? 4 min read How to add many functions in one ng-click directive? 2 min read How to directly update a field by using ng-click in AngularJS ? 3 min read How to Add Dynamic Options for Multiple Selects Inside ng-repeat Directive ? 3 min read How to detect when an @Input() value changes in Angular? 3 min read How to open popup using Angular and Bootstrap ? 2 min read How to reload or re-render the entire page using AngularJS? 2 min read How to add input fields dynamically on button click in AngularJS ? 2 min read How to Create Button Dynamically with Click Event in Angular ? 2 min read How to use jQuery in Angular ? 2 min read AngularJS Examples 2 min read My Profile ${profileImgHtml} My Profile Edit Profile My Courses Join Community Transactions Logout Like