【发布时间】:2021-09-18 05:37:03
【问题描述】:
从反应应用程序中,我从日期选择器获取日期。我正在尝试保存它 火力基地。它在数据库中正确保存,但不是 TYPE 作为“时间戳”,而是像“地图”一样保存。我正在向我们创建的 firebase 函数发送数据。通过该功能,我们将数据保存到集合中。请有任何建议。
const d = new Date("27-5-2021")
firebase.firestore.Timestamp.fromDate(d)
(OR)
firebase.firestore.Timestamp.fromMillis(d.getTime())
【问题讨论】:
-
这篇文章能回答你的问题吗? - stackoverflow.com/a/51345197/3833743