How To Serialize Firestore Timestamp In Android Java?
I am passing a Class as Extras and the class has TimeStamp as a member and getting the following error, how to serialize TimeStamp? Error: java.io.NotSerializableException: com.goo
Solution 1:
Timestamp contains just two numbers, seconds and nanoseconds. You can serialize them each separately, then recreate the Timestamp using its constructor that takes both values. Or you can take advantage of the fact that it's Parcelable.
Solution 2:
convert it to date Date myDate=timeStamp.ToDate()
and serialize if you want to convert bake to timestamp you can use new Timestamp(myDate)
Post a Comment for "How To Serialize Firestore Timestamp In Android Java?"