How to serialize Firestore TimeStamp in Android Java? Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of How to serialize Firestore TimeStamp in Android Java? without wasting too much if your time.

The question is published on by Tutorial Guruji team.

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.google.firebase.Timestamp

Answer

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.

We are here to answer your question about How to serialize Firestore TimeStamp in Android Java? - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji