I am trying to just get the date from the Datetime. I have below mytime variable which holds the date and time, here I just need the date in the yyyy-MM-dd format
$scope.mytime = new Date();
I tried doing few things but it doesnt work
$scope.mytime.getdate();
which just returns 8 but I am looking for yyyy-MM-dd
I also did try
$scope.newTime = $filter('date')(new Date(), "dd-MM-yyyy");
Got $filter is not defined
$filterinto your controller.