Angularjs, how to display DateTime in cshtml

前端 未结 2 1917
野的像风
野的像风 2021-01-22 01:16

I wrote a piece of code for getting a list of record from db and put them in $scope.records.

var app = angular.module(\'MyApp\', []);
app.controller(\'MyAppContr         


        
相关标签:
2条回答
  • 2021-01-22 01:48

    try with date filter

    {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
    

    or

    {{record.SubmitDate.replace('/Date(','').replace(')/','') | date:'yyyy-MM-dd HH:mm:ss Z'}}
    
    0 讨论(0)
  • 2021-01-22 01:55

    Try the new Date function as $scope.date = new Date (1472522357080); and bind the same $scope.date variable as ng-model to the date control.

    0 讨论(0)
提交回复
热议问题