AngularJS get formatted date in ng-model

前端 未结 3 1781
星月不相逢
星月不相逢 2020-12-18 18:38

I have following text input filled by model value in timestamp:



        
3条回答
  •  庸人自扰
    2020-12-18 19:19

    You can also specify a timezone like this:

    $scope.$watch('workerDetail.dateOfBirth', function (newDate) {
        $scope.workerDetail.dateOfBirth = $filter('date')(newDate, 'HH:mm', 'UTC'); 
    });
    

提交回复
热议问题