I am trying to get a timestamp from cloud firestore and store it in a date variable but I am getting this exception :
java.util.HashMap cannot be cast to java.util.Date
this is the code for getting the value from the cloud firestore :
Date timeStamp = (Date) dataSnapshot.get("date");
and this is the code for storing the date in the database :
map.put("date", ServerValue.TIMESTAMP);
I can't figure out how to solve this error