从react应用程序中,我从datepicker中获取日期。我正试着把它保存在firebase上。它正确地保存在数据库中,但不是类型为“timestamp”,而是像“map”一样保存。我正在向我们创建的firebase函数发送数据。通过该函数,我们将数据保存到集合中。有什么建议请提出来。
const d = new Date("27-5-2021")
firebase.firestore.Timestamp.fromDate(d)
(OR)
firebase.firestore.Timestamp.fromMillis(d.getTime())

发布于 2021-07-08 00:45:38
我认为您需要这样做,以将其保存为firebase上的时间戳。
firebase.firestore.Timestamp.fromDate(date).toDate());https://stackoverflow.com/questions/68290003
复制相似问题