I am working on an app that keeps track of travelling times
Consider the following example:
Trip 1 : Distance: 550km; TravelTime: 14:55 (14hours, 55 minutes)
Trip 2 : Distance: 230km; TravelTime: 12:25
Trip 3 : Distance: 140km; TravelTime: 10:44
I store the travel times as a long (Milliseconds from 1970-01-01). This all works fine, until I get a Travel time of more than 24 hours, or, obviously, when I want to display the total hours traveled.
Is there a way to format a date to a string that would show a date as an amount of hours and minutes, instead of the hours and minutes of the date?
As soon as I have a value of 26:10 (26 hours, 10 mins), the SimpleDateFormat will show "02:10" as it runs over to the next day, instead of the desired "26:10". Is there a way around this, or would I be better off creating a parser for that myself? Do not mind if that is the answer, just prefer not to re-invent the wheel ;)
Thanks in advance