How do I properly display the date and time in AngularJS?
The output below shows both the input and the output, with and without the AngularJS date filter:
You can use momentjs to implement date-time filter in angularjs.
For example:
angular.module('myApp')
.filter('formatDateTime', function ($filter) {
return function (date, format) {
if (date) {
return moment(Number(date)).format(format || "DD/MM/YYYY h:mm A");
}
else
return "";
};
});
Where date is in time stamp format.