Angular2 date pipe automatically adding timezone to date

﹥>﹥吖頭↗ 提交于 2019-12-05 10:22:32

The string 1987-06-15T00:00:00.000Z represents different dates in different browser time zones.

Fix

If you don't want to change the date based on time zone, just use string parsing (e.g. substr) and not date parsing.

This code is worked for me

<div>{{date_of_birth.split("T")[0] | date}}</div>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!