我需要從2017-02-15T09:37:16.087Z得到時間。我如何將它轉換爲通用格式時間戳?我得到的時間爲2017-02-15T09:37:16.087Z
。這是我的代碼:如何從JavaScript獲取日期時間?
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope, $http) {
$http.get('url', {})
.then(function (response) {
$scope.names = response.data;
});
});
</script>
<div ng-app="myApp" ng-controller="myCtrl" align="center">
<table>
<tr>
<td>device time stamp</td><td>{{names.timestamp}}</td>
</tr>
</table>
</div>
非常感謝你@brian – Swapna