Localized date formatting:
- ({{Today | date: ' Medium '}}) Feb 8:46:41 AM
- ({{Today | date: ' Short '}}) 2/17/16 8:46 AM
- ({{Today | date: ' fulldate '}}) Wednesday, February 17, 2016
- ({{Today | date: ' longdate '}}) February 17, 2016
- ({{Today | date: ' mediumdate '}}) Feb 17, 2016
- ({{Today | date: ' ShortDate '}}) 2/17/16
- ({{Today | date: ' Mediumtime '}}) 8:46:41 AM
- ({{Today | date: ' Shorttime '}}) 8:46 AM
- Year formatting:
- Four-bit year:({{today | date: ' YYYY '}})
- Two-bit year:({{today | date: ' yy '}})
- One year:({{today | date: ' y '}})
- Month Formatting:
- English Month:({{today | date: ' MMMM '}}) February
- English month Abbreviation:({{today | date: ' MMM '}})
- Two-digit month:({{today | date: ' MM '}})
- The month ordinal of the year:({{today | date: ' M '}}) 2
- Date formatting:
- Numeric Date:({{today | date: ' DD '}})
- Day of the one month:({{today | date: ' d '}})
- English Week:({{today | date: ' EEEE '}}) Wednesday
- English week abbreviation:({{today | date: ' EEE '}}) Wed
- Hour formatting:
- 24-hour Digital Hours:({{today | date: ' HH '}})
- Hours of the day:({{today | date: ' H '}}) 8
- 12-hour Digital Hours:({{today | date: ' HH '}})
- Hours of the morning or afternoon:({{today | date: ' h '}}) 8
- Minute formatting:
- Number of minutes:({{today | date: ' mm '}})
- The first minute of the One hour:({{today | date: ' m '}})
- Number of seconds to format:
- Number of seconds:({{today | date: ' SS '}})
- Seconds in a minute:({{today | date: ' s '}})
- Number of milliseconds to format:
- Number of milliseconds:({{today | date: ' SSS '}})
- Character formatting:
- Last PM ID:({{today | date: ' A '}}) AM
- Four-bit time zone ID:({{today | date: ' Z '}}) +0800
- Custom date formatting:
- Date:({{today | date: ' YYYY-MM-DD '}}) 2016-02-17
- Time and seconds:({{today | date: ' HH:MM:SS.SSS '}}) 08:46:41.150
JS Code
var myApp = angular.module (' MyApp ', []), Myapp.controller (' Myctrl ', [' $scope ', ' $parse ', function ($scope, $parse) { $scope. Today = new Date (); }]);
Angularjs Getting Started Tutorial: Date formatting