I want to get the difference between two times P (start time) and Q (end time) using Joda Time. P and Q could be times on different days or even on the same day. I want to get the difference in format HH-MM-SS, where H=hours, M=minutes, S=seconds.
I want to use this functionality in a timer. I assume that no one will use my timer to measure more than 24 hours.
Please guide me to do this.
Take a look at the Joda time FAQ
http://joda-time.sourceforge.net/faq.html#datediff
And you can use a
PeriodFormatterto get the format of your choice. Try the following sample code.