Angular 4 Date Pipe converting wrongly

前端 未结 4 1791
栀梦
栀梦 2020-12-09 17:14

I have rest service which returns a collection of objects and one of the field of the item is a date string (ISO-8601 format ) and the date value as follows

4条回答
  •  攒了一身酷
    2020-12-09 17:55

    You can pass another param to date pipe as follows:

    {{resultItem.createdDate | date : 'short' : 'UTC'}}

    This param can be a timezone like '-0430' or just 'GMT'

    See documentation: https://docs.angularjs.org/api/ng/filter/date

提交回复
热议问题