javascript - DD/MM/YYYY Date format in Moment.js -
how can change current date format(dd/mm/yyyy) using moment.js?
i have tried below code.
$scope.searchdate = moment(new date(), "dd/mm/yyyy");
but it's return 0037-11-24t18:30:00.000z
. did't format current date.
you need call format() function formatted value
$scope.searchdate = moment(new date()).format("dd/mm/yyyy") //or $scope.searchdate = moment().format("dd/mm/yyyy")
the syntax have used used parse given string date object using specified formate
Comments
Post a Comment