【发布时间】:2019-10-18 20:32:36
【问题描述】:
我正在尝试通过将秒数传递给它来创建一个 Firebase Firestore 时间戳对象,但它不起作用。
这是代码 sn-p。
import com.google.firebase.Timestamp
import com.google.firebase.firestore.*
var timeStampString:String = "1438910477"
var t = timeStampString.toLong()
var ts = Timestamp(t)
我收到错误:
None of the following functions can be called with the arguments supplied
<Init>(Parcel) defined in com.google.firebase.Timestamp
<Init>(Date) defined in com.google.firebase.Timestamp
我将数字作为documentation 中提到的参数传递。但它期待“包裹”或“日期”。
我做错了什么?
【问题讨论】:
标签: android firebase kotlin google-cloud-firestore