I need to get a time between two dates. Let's say dateStart = 1470712122173
and dateStop = 1470712127320
.
The difference between this two dates equals to 5147
So, according to this I expect to get an answer = 5 seconds but I see 19:00:05
. Where these 19 hours come from?
Code for milliseconds ( = 5147) -> time:
private string foo(long dateStart, long dateStop) {
long diff = dateStop - dateStart;
DateFormat simple = SimpleDateFormat.getTimeInstance();
Date date = new Date(diff);
return simple.format(date);
}
Thank you for explanation.