Reputation: 1
String time = String.valueOf(FieldValue.serverTimestamp());
Whenever I upload this to the cloud, it doesn't enter it in the desired format.
How can I force the desired format when uploading this data to cloud?
Upvotes: 0
Views: 110
Reputation: 31
Firestore has own field type called "Timestamp". You can in your class create field type Timestamp with Firestore annotation:
@ServerTimestamp
private Timestamp timeStamp;
And leave this field as null, during uploading firestore will automatically fill this field with server timestamp.
I hope it will help
Upvotes: 1