depends on your requirements...
if we talk about short intervalls of minutes or hours or so, just get the difference of the millis and recalculate to seconds, minutes, whatever
if we talk about intervalls of days, months, years (leap years!) take joda-time. (just google it)
concerning code examples: the
philosophy of this forum is more to help learning than to provide solutions. so, better show us what you did already, and then get help from many friendly users here... :-)
best regards,
jan