I have a date format in the following way,
"tranDate": "2015-11-02T18:30:00.000Z"
how do i format the date and time in human readable way.
date: 2015-11-02
time: 18:30:00
Since your string contains Zulu time, first convert the string to a date using new Date as follows:
$scope.date = new Date(obj['tranDate'].replace(' ', 'T'))
Then use angular's inbuilt date filters. in the template. Example:
{{date | date: 'd MMM yyyy'}}
IN CONCROLLER
put the following code in controller
$scope.date_test = {"tranDate": new Date()}
IN HTML
date : {{date_test.tranDate | date: 'yyyy-M-dd'}}
time : {{date_test.tranDate | date:"h:mm:ss"}}
This is an exmaple of formating the date and time