Subtract date,time using Calendar() or Date()
843810Sep 13 2004 — edited Sep 20 2006Hello everybody. I created a JFrame application connecting to Ms SQL server. I want to subtract the days and the total time in hours,minutes,secs. I was wondering if there are already build-functions in Calendar() class or in Date() class to subtract dates and times at once.
For example, let say that we have Date 13/09/2004 and time=15:09:03 and I would like to subtract from them the Date 14/09/2004 and time= 02:11:01.Is any function pre-build to simply output the result Final Time 11 hours 1 minutes and 58 seconds?Or do I have to calculate them manually?
I read both API classes and the only interesting I found was to convert both times in miliseconds and then convert the final one in time again.
I really appreciate any help.Thank you.