There is a lot of similar topics but I couldn't find something similar then my problem. I've found only how to calculate if for example second time is greater then first time, like:
- 22:00
- 23:00
The result is easy to get. Just subtract second time with first using Date API. Difference is in milliseconds and you can easily convert them in seconds/minutes..
What I want to know, how to get difference between time in first day and time in second day, for example:
- 22:25
- 06:30
Difference should be 8 hours and 5 minutes.
Or another example
- 19:00
- 00:00
Difference should be 5 hours.
How to calculate time in this way? Any help is appreciated.