Reputation: 4599
i have date format getting from server in the following way,
"tranDate":"2015-11-29T18:30:00.000Z"
I tried to displaying the date in the view like this, but the date is showing - 30/11/2015(i.e it should be 29/11/2015).
<td>{{stmt.tranDate | date:'dd/MM/yyyy'}}</td>
what could be the problem?
Upvotes: 3
Views: 2185
Reputation: 10101
As of Angular 1.3 you can specify that you want the time to be interpreted in UTC.
<td>{{stmt.tranDate | date:'dd/MM/yyyy' : 'UTC'}}</td>
Upvotes: 2
Reputation: 896
You should try with moment.js and with tha angular-moment
directive
Upvotes: 1
Reputation: 1212
You can apply this format then you have the desired date .
$scope.datex="2015-11-29T18:30:00.000Z";
<p>{{datex | date:'d/M/yyyy'}}</p>
Upvotes: 1
Reputation: 3573
Your time is in Zulu time (Z in the end). Angular displays time in your local time.
Upvotes: 4