I\'m currently trying to determine the amount of time between two dates (one of which is the present date/time, the other an arbitrary future date). I\'m using native Java a
Instead of doing this :
long x = difference / 1000;
seconds = x % 60;
x /= 60;
minutes = x % 60;
x /= 60;
hours = x % 24;
x /= 24;
days = x;
build a Date object with the difference between the two dates (long value). Then you can do a setDate(Date) on a Calendar object and parse it.
Alternatively, you can take a look at the Joda Time Api, which is relatively easy to use.