Javascript 格式为Angularjs/Date(-226612800000)/

Javascript 格式为Angularjs/Date(-226612800000)/,javascript,angularjs,Javascript,Angularjs,我通过一个带有负号的服务获得信息,我必须格式化dd/MM/yyyy 实际日期=1962年10月27日 var date = "/Date(-226612800000)/"; //This is the date that arrives for the service $scope.Date = new Date(parseInt(date.match(/\/Date\(([0-9]*)\)\//)[1])); alert($scope.Date); 这个负号给我带来了麻烦 我必须

我通过一个带有负号的服务获得信息,我必须格式化dd/MM/yyyy

实际日期=1962年10月27日

var date = "/Date(-226612800000)/";     //This is the date that arrives for the service

$scope.Date = new Date(parseInt(date.match(/\/Date\(([0-9]*)\)\//)[1]));

alert($scope.Date);
这个负号给我带来了麻烦
我必须处理AngularJS控制器中的所有内容

-
字符添加到匹配器:

var-date=“/date(-226612800000)/”//这是服务到达的日期
var date2=新日期(parseInt(Date.match(/\/Date\([-0-9]*)\)\/)[1]);
控制台日志(日期2)