简体   繁体   English

iPad、iPhone Safari 浏览器 - 时间问题,时差 5 小时

[英]iPad, iPhone Safari Browser - Time issue, 5 hours difference

const pickupDate = format(this.pickupAddressComponent.pickupDate, 'YYYY-MM-dd\'T\'HH:mm:ss');

I had an issue with time in iPad and iPhone safari browser.我在 iPad 和 iPhone Safari 浏览器中遇到了时间问题。

I selected the 11:00 AM pickup time (this is how it's storing "2019-07-30T11:00:00"), when I retrieve it from the local store the time is changed and showing as 06:00 AM (5 hours difference).我选择了上午 11:00 取货时间(这是它存储“2019-07-30T11:00:00”的方式),当我从本地商店检索它时,时间已更改并显示为上午 06:00(5 小时)区别)。 and it is only happening in iPad, iPhone safari browser, any idea what's the issue/root cause is ??它只发生在 iPad、iPhone Safari 浏览器中,知道问题/根本原因是什么吗?

Found the root cause,找到了根本原因,

I'm using ngRx store module and added the restoreDates flag and set it to false in index.ts and it's working as expected.我正在使用 ngRx 存储模块并添加了restoreDates标志并将其在 index.ts 中设置为 false 并且它按预期工作。

restoreDates (boolean? = true) : Restore serialized date objects. restoreDates (boolean? = true) :恢复序列化的日期对象。 If you work directly with ISO date strings, set this option to false .如果您直接使用 ISO 日期字符串,请将此选项设置为false

for reference: https://www.npmjs.com/package/ngrx-store-localstorage供参考: https : //www.npmjs.com/package/ngrx-store-localstorage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM