Home
Tutorials
Microsoft Technologies Tutorials
Java Programming Tutorials
Web Designing Tutorials
Script Programming Tutorials
Database Programming Tutorials
Mobile Technologies Tutorials
Other Programming Tutorials
Examples
Articles
Tools
News
AngularJS Date Filter Example
Keywords : Angularjs format date using date filter example, Angularjs change date format with date filter example, Use date filter in angularjs with example
Example
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> AngularJs Date filter Example </title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script> var app = angular.module("AngulardateApp", []); app.controller("datectrl", function ($scope) { $scope.sampledate = new Date(); }); </script> </head> <body ng-app="AngulardateApp"> <h2>AngularJS Date Filter Example</h2> <div ng-controller="datectrl"> Enter Number: <input type="text" ng-model="sampledate" style="width:400px" /><br /><br /> Date with short expression:{{sampledate | date:"short" }}<br /><br /> Date with mediumDate expression: {{sampledate | date : "mediumDate"}} <br /><br /> Date with yyyy-mm-dd hh:mm:ss expression: {{sampledate | date : "yyyy-mm-dd hh:mm:ss" : 0}} <br /><br /> Date with yyyy-mm-dd hh:mm:ss expression: {{sampledate | date : "dd/mm/yyyy 'at' hh:mma" : 0}} </div> </body> </html>
Click Here to See Result
Result
Previous
Next