【问题标题】:why date pipe is showing wrong format in chrome,chromium and opera?为什么日期管道在铬、铬和歌剧中显示错误的格式?
【发布时间】:2020-03-02 14:19:51
【问题描述】:

i have given date format as date:'dd-MM-yyyy HH:mm:ss' but it is showing 02-03-2020 24:45:00 大家好,我们使用 angular 4。我们使用 angular date pipe 将日期格式化为 dd-MM-yyyy HH:mm:ss。从上周开始,格式无法正常工作,而不是在清晨显示 02-03-2020 00:45:00,它显示的是 02-03-2020 24:45:00 这是错误的. 谁能告诉我们为什么会这样。

注意:在 firefox 中显示正确,但在 chrome、chromium、opera 中显示错误

【问题讨论】:

    标签: angular datetime-format date-pipe


    【解决方案1】:

    您应该将您的应用程序升级到更新版本的 Angular。版本 5 中更正了日期管道问题:

    Stackblitz 在 Angular 4 中重现您的错误:https://stackblitz.com/edit/angular-scxsq6

    相同的代码,但升级到 Angular 5 可以工作:https://stackblitz.com/edit/angular-cf3ajh

    以及有关该问题的更多信息:https://github.com/angular/angular/issues/8319#issuecomment-318576526

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-23
      • 2021-12-14
      • 2012-03-18
      • 1970-01-01
      • 1970-01-01
      • 2012-07-10
      相关资源
      最近更新 更多