Firestoreで取得したTimestampを、Kotlinで扱うためにDate型に変換します。
簡単です。
MainActivity.kt
//FirestoreのドキュメントからTimestampデータを取り出す
val firebase_timestamp = document.data["timestamp"] as com.google.firebase.Timestamp
//Date型へ変換する
val date = firebase_timestamp.toDate()
Go to list of users who liked
More than 3 years have passed since last update.
Firestoreで取得したTimestampを、Kotlinで扱うためにDate型に変換します。
簡単です。
//FirestoreのドキュメントからTimestampデータを取り出す
val firebase_timestamp = document.data["timestamp"] as com.google.firebase.Timestamp
//Date型へ変換する
val date = firebase_timestamp.toDate()
Register as a new user and use Qiita more conveniently
Go to list of users who liked