【问题标题】:Date result shows wrong [duplicate]日期结果显示错误[重复]
【发布时间】:2019-06-30 09:56:44
【问题描述】:

Json 结果出错

vr_date :Date

alert(this.vr_date ) // Result Shows Thu Feb 07 2019 00:00:00 GMT+0400

var json = JSON.stringify(this.vr_date);

alert(json); // Result Shows 2019-02-06T20:00:00.000Z see the date goes wrong

输出日期显示 06 而不是 07

请在此处找到应用程序 https://stackblitz.com/edit/angular-eavwul?file=app%2Fdatepicker-overview-example.ts

【问题讨论】:

标签: javascript json angular angular7


【解决方案1】:

一个日期是 UTC,另一个是 GMT+0400。

【讨论】:

  • 如何将日期选择器的 utc 更改为 gmt?
  • 也许将 ng-model-options="{timezone: 'utc'}" 添加到 标签有助于
猜你喜欢
  • 2013-07-31
  • 2017-03-13
  • 2011-02-10
  • 2018-07-09
  • 1970-01-01
  • 1970-01-01
  • 2015-02-20
  • 2018-04-20
相关资源
最近更新 更多