Cloud Firestore. , Date
. :
import java.util.Date;
public class YourModelClass {
@ServerTimestamp
private Date date;
YourModelClass() {}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
}
YourModelClass
. Firebase date
ServerTimestamp
(. ) .
FieldValue.serverTimestamp() :
Map<String, Object> map = new HashMap<>();
map.put("date", FieldValue.serverTimestamp());
docRef.update(map).addOnCompleteListener(new OnCompleteListener<Void>() {}