I am using AngularJS to get data from an ASP.NET server application and display it on the client side. Here is what I\'m getting:
If changing the format in MVC isn't an option, you can do this:
{{ team.CreatedOn.slice(6, -2) | date: 'yyyy-MM-dd HH:mm:ss' }}
The key bit is .slice(6, -2)—it trims off all the extra junk leaving you with just the epoch time.
If you use this a lot, you may prefer a custom filter. This one wraps the existing date filter:
.filter('mvcDate', ['$filter', $filter =>
(date, format, timezone) =>
date && $filter('date')(date.slice(6, -2), format, timezone)
]);
Now just replace the date filter with our custom one:
{{ team.CreatedOn | mvcDate: 'yyyy-MM-dd HH:mm:ss' }}
Here's a working example on JSFiddle.