I have two Date objects and I need to get the time difference so I can determine the total hours between them. They happen to be from the same day. The result I would like w
This should work.
long secs = (this.endDate.getTime() - this.startDate.getTime()) / 1000; int hours = secs / 3600; secs = secs % 3600; int mins = secs / 60; secs = secs % 60;