Question: how to calculate date and time difference 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.