Question: how to calculate time difference between two dates in android?
Answer: You can calculate the difference in time in miliseconds using this method and get the outputs in seconds, minutes, hours, days, months and years. long currentTime = System. currentTimeMillis(); long previousTime = (System. currentTimeMillis() - 864000000); //10 days ago Log.