Android Calculate Time Between Two

 

Use a Date object:

Date interestingDate = new Date();

You can find the different in milliseconds between the actual current date and interestingDate by doing:

long time = (new Date()).getTime() - interestingDate.getTime()

 

Posted in Android, Tips and Tricks Tagged with: ,