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

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -