我只想在网页中显示日期值。我正在获得这样的价值
2019-05-24T10:42:42.6899084
javascript代码
$scope.date = $scope.myWelcome.updatedDate;
SQL Server中的示例数据
UpdatedDate
2019-05-24 10:27:01.6972592
Json Response
{"id":8,"updatedDate":"2019-05-24T12:48:25.3853657"}
Exp OP-
24-05-2019
HTML
<h3>{{ date.date | date:'dd/MM/yyyy'}}</h3>
答案 0 :(得分:1)
答案 1 :(得分:1)
您可以使用slice(0,10)
$ scope.date = $ scope.myWelcome.updatedDate.slice(0,10);
//输出
2019-05-24
var d = {"id":8,"updatedDate":"2019-05-24T12:48:25.3853657"}
var a = d.updatedDate.slice(0, 10);
console.log(a);