- localized date formatting:
-
-
-
-
- ({{today | date: ' mediumdate '}}):
-
-
-
- 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 '}}) November
- English month Abbreviation:({{today | date: ' MMM '}})
- Two-digit month:({{today | date: ' MM '}})
- The month ordinal of the year:({{today | date: ' M '}})
- date formatting:
- Numeric Date:
- The day of the one month,
- English week: ({{Today | date : ' Eeee '}}) Tuesday
- English weekday:
- Hour formatting:
- 24-hour Digital Hours:({{today | date: ' HH '}})
- Hours of the day:({{today | date: ' H '}})
- 12-hour Digital Hours:({{today | date: ' HH '}})
- Hours of the morning or afternoon:({{today | date: ' h '}}) 2
- 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 '}}) 579
- Character formatting:
- Last PM ID:({{today | date: ' A '}}) PM
- Four-bit time zone ID:({{today | date: ' Z '}}) +0800
- Custom date formatting:
- Date:({{today | date: ' YYYY-MM-DD '}}) 2015-11-24
- Time and seconds:({{today | date: ' HH:MM:SS.SSS '}}) 14:19:24.579
source code for this lesson
| 1 2 3 4 |
var myApp = angular.module(‘myApp‘, []);myApp.controller(‘MyController‘,[‘$scope‘, ‘$parse‘, function($scope, $parse) { $scope.today = new Date(); }]); |
Angular Basic Tutorial: expression date formatting [go]