【发布时间】:2021-03-08 18:55:40
【问题描述】:
这就是发生的事情:在云函数中,我有一个日期,我正在一个 Firestore 文档上写入,将日期转换为时间戳,如下所示:admin.firestore.Timestamp.fromDate(new Date(dateExample))
当我在云功能上控制台记录日期时,它显示:Mon Mar 15 2021 00:00:00 GMT+0000
但在 Firestore 上,日期是 14 march 2020 21:00 UTC-3。
它减去 3 小时,这使得日期为 -1 天。
我怎样才能解决这个问题?我需要日期至少是同一天。
【问题讨论】:
标签: firebase date google-cloud-firestore google-cloud-functions timezone