Iam using ServerValue.TimeStamp and upload to firebase using hashmap
HashMap<String, Object> map = new HashMap();
map.put("timestamp", ServerValue.TIMESTAMP);
but I need to get the value of TimeStamp in long without upload it to the firebase I have tried to cast it to long but always receive ClassCastException
Map<String, Object> currentTime = new HashMap<>();
currentTime.put("timestamp", ServerValue.TIMESTAMP);
return (long) currentTime.get("timestamp");
any help ?!

