How can I show correctly Dates yyyy-MM-dd hh:mm:ss with HTML5 and Angularjs?

前端 未结 2 723
我在风中等你
我在风中等你 2021-01-28 12:18

I\'m trying to create an input with date and time but I don\'t get the way of doing it.

I\'ve tried with input datetime,


  &         


        
2条回答
  •  耶瑟儿~
    2021-01-28 12:56

    You could try using date $filter component:

    $scope.tToDisplay = $filter('date')($scope.timestamp, 'yyyy-MM-dd HH:mm:ss');
    

    and bind it to HTML like:

    
    

    Make sure to include $filter as a dependency. More info on the formats.

提交回复
热议问题